Hi,

This old RegCNET discussion is related with Postrproc, which used to have this same error with some versions of the compilers.  CRU code has similar issue, which is with the netcdf subroutines in CRU2RCM.f. Real solution to this problem is as following:

Remove all the netcdf related subroutines from CRU2RCM.f and then compile the code with netcdf.f in the PostProc folder. So basically one should remove lines 793-3025 in CRU2RCM.f (yes, these are about 2500 lines!). After that copy netcdf.f and netcdf.inc from PostProc folder. Make changes in Makefile to include netcdf.f in the compilation. One can get help from Makefile in PostProc to have an idea on that. 

Still have issues "AFTER" doing all this? let me know.

Moet



On Mar 2, 2010, at 4:19 AM, sh zhou wrote:

Hi , when I used CRU data, i got a error message as following, someone said that it might be caused by the compiler version, my compiler is PGI-7.1-6.(https://lists.ictp.it/pipermail/regcnet/2007/000777.html). Does anyone else know how to solve it ? what  preparation should I do before using CRU data?  please give me a hand. Thank you very much.

####
CRU2RCM.f:
 INPUT FILE:cru-data/CRUPRE.CDF      
                        
 cru-data/CRUTMP.CDF                              
 cru-data/CRUDTR.CDF                              
 cru-data/CRUVAP.CDF                              
 cru-data/CRUCLD.CDF                              
 cru-data/CRUFRS.CDF                              
 cru-data/CRUTMN.CDF                              
 cru-data/CRUTMX.CDF                              
 cru-data/CRUWET.CDF                              
 OUTPUT FILE:PRE1993.nc                                       
 TMP1993.nc                                       
 DTR1993.nc                                       
 VAP1993.nc                                       
 CLD1993.nc                                       
 FRS1993.nc                                       
 TMN1993.nc                                       
 TMX1993.nc                                       
 WET1993.nc                                       
 CALL PARAM
 DS=   60.00000    DDEG=  5.3967768E-04
   -4.888416       37.03973       1050.000       32.60123       54.29552   
    1050.000   
 OPENING NetCDF FILE: PRE1993.nc                                       
 ITIM=        1105
 READ/WRITE: PRE         1993011500        1105   815568.0000000000    
ncvarid: ncid 4: Variable not found
ncdimid: ncid 4: Invalid dimension id or name
ncvarid: ncid 4: Variable not found
ncvarid: ncid 4: Variable not found
*ERROR* in putdef in grbtst
####
 
my cru.param:
###
c ** PGI compile: pgf77 CRU2RCM.f -L../../Commons/env/liblinux -lnetcdf
c ** IFC compile: ifc -tpp7 -O3 -cm -w -w90 -w95 CRU2RCM.f -L../../Commons/env/liblinux -lnetcdf -o cru

C ** idatecru0 = First year-month of the CRU dataset (YYYYMM)
C ** idatecru1 = First year-month desired (YYYYMM)
C ** idatecru2 = Last year-month desired (YYYYMM)
      integer idatecru0, idatecru1, idatecru2
      parameter(idatecru0=190101)
      parameter(idatecru1=199801)
      parameter(idatecru2=199812)

C ** ORIGINAL CRU GRID
C ** nfld  = number of CRU fields
C ** nlon  = number of longitudes
C ** nlat  = number of latitudes
C ** dlon  = Resolution in the x-direction
C ** dlat  = Resolution in the y-direction
C ** glon1 = Longitude position of the western most point
C ** glat1 = Latitude position of the southern most point
      integer nfld, ifld, nlon, nlat
      real glon1, glat1, dlat, dlon
      PARAMETER (nfld=5)
      PARAMETER (NLON=720, NLAT=360, dlat=0.5, dlon=0.5 )
      PARAMETER (GLON1=-179.75, GLAT1=-89.75)

c NAME OF THE CRU FILES ON THE RegCM GRID.
      character outfile(nfld)*50
      DATA  (outfile(ifld),ifld=1,nfld)
     &   /'TMP1998.nc'
     &   ,'PRE1998.nc'
     &   ,'DTR1998.nc'
     &   ,'VAP1998.nc'
     &   ,'CLD1998.nc'/

c NAME OF THE GLOBAL INPUT CRU FILES
      character infile(nfld)*50
      DATA  (infile(ifld),ifld=1,nfld)
     &   /'/mnt/data/data-regcm/cru/CRUTMP.CDF'
     &   ,'/mnt/data/data-regcm/cru/CRUPRE.CDF'
     &   ,'/mnt/data/data-regcm/cru/CRUDTR.CDF'
     &   ,'/mnt/data/data-regcm/cru/CRUVAP.CDF'
     &   ,'/mnt/data/data-regcm/cru/CRUCLD.CDF'/


c NAME OF THE CRU VARIABLES
      character vnam(nfld)*10
      DATA  (vnam(ifld),ifld=1,nfld)
     &   /'TMP'
     &   ,'PRE'
     &   ,'DTR'
     &   ,'VAP'
     &   ,'CLD'/
###


Thank you for your time.


--
Shenghui                    Student
Major:                         Physics
HuNan University          China
_______________________________________________
RegCNET mailing list
RegCNET@lists.ictp.it
https://lists.ictp.it/mailman/listinfo/regcnet