Ignore:
Timestamp:
Oct 5, 2021, 8:34:09 AM (3 years ago)
Author:
emillour
Message:

Mars GCM utilities:
Minor fixes to run with picky gfortran 10.3.0 which requires one element arrays
(rather than scalars) when calling NetCDF routines, andf that stop statements
should not be followed by strings. While at it replaced tabs with spaces.
EM

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/LMDZ.MARS/util/lslin.F90

    r2450 r2567  
    131131   write(*,*) 'Failed to open file '//infile
    132132   write(*,*) NF_STRERROR(ierr)
    133    stop ""
     133   stop
    134134endif
    135135
     
    149149    write(*,*) "Failed to get number of dims for variable number:",start_var
    150150    write(*,*) NF_STRERROR(ierr)
    151     stop ""
     151    stop
    152152  endif
    153153enddo
     
    188188      write(*,*) 'ERROR: Field <latitude> is missing'
    189189      write(*,*) NF_STRERROR(ierr)
    190       stop ""
     190      stop
    191191   endif
    192192   ierr=NF_INQ_DIMLEN(nid,latdim,latlen)
     
    198198      write(*,*) 'ERROR: Field <longitude> is missing'
    199199      write(*,*) NF_STRERROR(ierr)
    200       stop ""
     200      stop
    201201   endif
    202202   ierr=NF_INQ_DIMLEN(nid,londim,lonlen)
     
    208208      write(*,*) 'ERROR: Field <altitude> is missing'
    209209      write(*,*) NF_STRERROR(ierr)
    210 !     stop ""
     210!     stop
    211211       altlen = 1
    212212   else
     
    239239      write(*,*) ' Dimension <index> is missing in file '//trim(infile)
    240240      ctllen=0
    241       !stop ""
     241      !stop
    242242   endif
    243243   ierr=NF_INQ_VARID(nid,"controle",ctlvar)
     
    245245      write(*,*) 'Field <controle> is missing in file '//trim(infile)
    246246      ctllen=0
    247       !stop ""
     247      !stop
    248248   else
    249249      ierr=NF_INQ_DIMLEN(nid,ctldim,ctllen)
     
    289289   write(*,*) 'ERROR: Dimension <Time> is missing'
    290290   write(*,*) NF_STRERROR(ierr)
    291    stop ""
     291   stop
    292292endif
    293293ierr=NF_INQ_VARID(nid,"Time",timevar)
     
    295295   write(*,*) 'ERROR: Field <Time> is missing'
    296296   write(*,*) NF_STRERROR(ierr)
    297    stop ""
     297   stop
    298298endif
    299299
     
    407407
    408408do k=1,Nls
    409   ierr= NF_PUT_VARA_REAL(nout,timevarout,k,1,timels(k))
     409  ierr= NF_PUT_VARA_REAL(nout,timevarout,(/k/),(/1/),timels(k))
    410410enddo
    411411
     
    426426      write(*,*) 'ERROR: Field <',var(j),'> not found'
    427427      write(*,*) NF_STRERROR(ierr)
    428       stop "Better stop now..."
     428      write(*,*) "Better stop now..."
     429      stop
    429430   endif
    430431   
     
    589590   if (ierr.ne.NF_NOERR) then
    590591     write(*,*) 'PUT_VAR ERROR: ',NF_STRERROR(ierr)
    591      stop ""
     592     stop
    592593   endif
    593594
     
    716717   WRITE(*,*)'ERROR: Impossible to create the file ',trim(filename)
    717718   write(*,*) NF_STRERROR(ierr)
    718    stop ""
     719   stop
    719720endif
    720721
     
    727728   WRITE(*,*)'initiate: error failed to define dimension <latitude>'
    728729   write(*,*) NF_STRERROR(ierr)
    729    stop ""
     730   stop
    730731endif
    731732ierr = NF_DEF_DIM(nout, "longitude", lonlen, londimout)
     
    733734   WRITE(*,*)'initiate: error failed to define dimension <longitude>'
    734735   write(*,*) NF_STRERROR(ierr)
    735    stop ""
     736   stop
    736737endif
    737738ierr = NF_DEF_DIM(nout, "altitude", altlen, altdimout)
     
    739740   WRITE(*,*)'initiate: error failed to define dimension <altitude>'
    740741   write(*,*) NF_STRERROR(ierr)
    741    stop ""
     742   stop
    742743endif
    743744if (size(ctl).ne.0) then
     
    746747    WRITE(*,*)'initiate: error failed to define dimension <index>'
    747748    write(*,*) NF_STRERROR(ierr)
    748     stop ""
     749    stop
    749750  endif
    750751endif
     
    753754   WRITE(*,*)'initiate: error failed to define dimension <Time>'
    754755   write(*,*) NF_STRERROR(ierr)
    755    stop ""
     756   stop
    756757endif
    757758
     
    761762   WRITE(*,*)'initiate: error failed to switch out of define mode'
    762763   write(*,*) NF_STRERROR(ierr)
    763    stop ""
     764   stop
    764765endif
    765766
     
    785786   WRITE(*,*)'initiate: error failed writing variable <latitude>'
    786787   write(*,*) NF_STRERROR(ierr)
    787    stop ""
     788   stop
    788789endif
    789790
     
    799800   WRITE(*,*)'initiate: error failed writing variable <longitude>'
    800801   write(*,*) NF_STRERROR(ierr)
    801    stop ""
     802   stop
    802803endif
    803804
     
    822823   WRITE(*,*)'initiate: error failed writing variable <altitude>'
    823824   write(*,*) NF_STRERROR(ierr)
    824    stop ""
     825   stop
    825826endif
    826827
     
    844845      WRITE(*,*)'initiate: error failed writing variable <controle>'
    845846      write(*,*) NF_STRERROR(ierr)
    846       stop ""
     847      stop
    847848   endif
    848849endif
     
    917918    ierr=NF_GET_VAR_REAL(infid,tmpvarid,aps)
    918919    if (ierr.ne.NF_NOERR) then
    919      stop "init2 error: Failed reading aps"
     920     write(*,*) "init2 error: Failed reading aps"
     921     stop
    920922     aps_ok=.false.
    921923    endif
     
    945947    ierr=NF_GET_VAR_REAL(infid,tmpvarid,bps)
    946948    if (ierr.ne.NF_NOERR) then
    947       stop "init2 Error: Failed reading bps"
     949      write(*,*) "init2 Error: Failed reading bps"
     950      stop
    948951      bps_ok=.false.
    949952    endif
     
    966969  ierr=NF_GET_VAR_REAL(infid,tmpvarid,phisinit)
    967970  if (ierr.ne.NF_NOERR) then
    968     stop "init2 Error: Failed reading phisinit"
     971    write(*,*) "init2 Error: Failed reading phisinit"
     972    stop
    969973  endif
    970974  phis = .true.
     
    985989               (/altdimout/),apsid,ierr)
    986990  if (ierr.ne.NF_NOERR) then
    987     stop "Error: Failed to def_var aps"
     991    write(*,*) "Error: Failed to def_var aps"
     992    stop
    988993  endif
    989994
     
    991996  ierr=NF_PUT_VAR_REAL(outfid,apsid,aps)
    992997  if (ierr.ne.NF_NOERR) then
    993     stop "Error: Failed to write aps"
     998    write(*,*) "Error: Failed to write aps"
     999    stop
    9941000  endif
    9951001ENDIF ! of IF (aps_ok)
     
    10001006               (/altdimout/),bpsid,ierr)
    10011007  if (ierr.ne.NF_NOERR) then
    1002     stop "Error: Failed to def_var bps"
     1008    write(*,*) "Error: Failed to def_var bps"
     1009    stop
    10031010  endif
    10041011
     
    10061013  ierr=NF_PUT_VAR_REAL(outfid,bpsid,bps)
    10071014  if (ierr.ne.NF_NOERR) then
    1008     stop "Error: Failed to write bps"
     1015    write(*,*) "Error: Failed to write bps"
     1016    stop
    10091017  endif
    10101018ENDIF ! of IF (bps_ok)
     
    10201028              (/londimout,latdimout/),phisinitid,ierr)
    10211029  if (ierr.ne.NF_NOERR) then
    1022      stop "Error: Failed to def_var phisinit"
     1030     write(*,*) "Error: Failed to def_var phisinit"
     1031     stop
    10231032  endif
    10241033
     
    10261035  ierr=NF_PUT_VAR_REAL(outfid,phisinitid,phisinit)
    10271036  if (ierr.ne.NF_NOERR) then
    1028     stop "Error: Failed to write phisinit"
     1037    write(*,*) "Error: Failed to write phisinit"
     1038    stop
    10291039  endif
    10301040
     
    11411151!   print*,'missing_value: valid_range attribution failed'
    11421152!   print*, NF_STRERROR(ierr)
    1143 !   stop ""
     1153!   stop
    11441154!endif
    11451155!*********************************************************
     
    11501160   print*, 'missing_value: missing value attribution failed'
    11511161   print*, NF_STRERROR(ierr)
    1152    stop ""
     1162   stop
    11531163endif
    11541164
Note: See TracChangeset for help on using the changeset viewer.