I'm trying to compile one particular numerical code named NEMO. I'm using PGI compiler and get the following error while I'm trying to run a case.
-> report : Performance report : Time spent for XIOS : 4.53964e-05
-> report : Performance report : Time spent in processing events : 0
-> report : Performance report : Ratio : 0%
-> report : Performance report : Time spent for XIOS : 4.54746e-05
-> report : Performance report : Time spent in processing events : 0
-> report : Performance report : Ratio : 0%
0: Null pointer for qrp (/home/user/local/NEMO-4.0/cfgs/MYGYRE/BLD/ppsrc/nemo/diawri.f90: 530)
0: Null pointer for qrp (/home/user/local/NEMO-4.0/cfgs/MYGYRE/BLD/ppsrc/nemo/diawri.f90: 530)
0: Null pointer for qrp (/home/user/local/NEMO-4.0/cfgs/MYGYRE/BLD/ppsrc/nemo/diawri.f90: 530)
0: Null pointer for qrp (/home/user/local/NEMO-4.0/cfgs/MYGYRE/BLD/ppsrc/nemo/diawri.f90: 530)
The corresponding code from the diawri.f90 file is as followed
530 CALL histwrite( nid_T, "sohefldp", it, qrp , ndim_hT, ndex_hT ) ! heat flux damping
Following is the interface of histwrite
INTERFACE histwrite
!---------------------------------------------------------------------
!- The "histwrite" routines will give the data to the I/O system.
!- It will trigger the operations to be performed,
!- and the writting to the file if needed
!-
!- We test for the work to be done at this time here so that at a
!- later stage we can call different operation and write subroutine
!- for the REAL and INTEGER interfaces
!-
!- INPUT
!- idf : The ID of the file on which this variable is to be,
!- written. The variable should have been defined in
!- this file before.
!- pvarname : The short name of the variable
!- pitau : Current timestep
!- pdata : The variable, I mean the real data !
!- nbindex : The number of indexes provided. If it is equal to
!- the size of the full field as provided in histdef
!- then nothing is done.
!- nindex : The indices used to expand the variable (pdata)
!- onto the full field.
This is the qrp definition
REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: qrp !: heat flux damping [w/m2]
I searched online and find some information saying this is due to a fortran 2003 standard about null pointer. And different compilers treat null pointer differently. As I know gfortran is mostly used for compiling this code and seemingly working fine. I would like to know what I can do to avoid the error without changing the compiler.
qrpdefined? If it isALLOCATABLEarray, is it allocated? How ishistwritedefined?