Changeset 2567


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

Location:
trunk/LMDZ.MARS/util
Files:
9 edited

Legend:

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

    r2443 r2567  
    13041304  hybrid=.true.
    13051305  if (ierr.ne.nf90_noerr) then
    1306     stop "init2 Error: Failed reading aps"
     1306    write(*,*) "init2 Error: Failed reading aps"
     1307    stop
    13071308  endif
    13081309
     
    13161317  ierr=nf90_inq_varid(gcmfid,"bps",tmpvarid)
    13171318  if (ierr.ne.nf90_noerr) then
    1318     stop "init2 Error: Failed to get bps ID."
     1319    write(*,*) "init2 Error: Failed to get bps ID."
     1320    stop
    13191321  endif
    13201322  ierr=NF90_GET_VAR(gcmfid,tmpvarid,bps)
    13211323  if (ierr.ne.nf90_noerr) then
    1322     stop "init2 Error: Failed reading bps"
     1324    write(*,*) "init2 Error: Failed reading bps"
     1325    stop
    13231326  endif
    13241327endif
     
    13381341    apbp=.true.
    13391342    if (ierr.ne.nf90_noerr) then
    1340       stop "Error: Failed reading ap"
     1343      write(*,*) "Error: Failed reading ap"
     1344      stop
    13411345    endif
    13421346  endif
     
    13571361    apbp=.true.
    13581362    if (ierr.ne.nf90_noerr) then
    1359       stop "Error: Failed reading bp"
     1363      write(*,*) "Error: Failed reading bp"
     1364      stop
    13601365    endif
    13611366  endif
     
    13721377  ierr=NF90_GET_VAR(gcmfid,tmpvarid,sigma)
    13731378  if (ierr.ne.nf90_noerr) then
    1374     stop "init2 Error: Failed reading sigma"
     1379    write(*,*) "init2 Error: Failed reading sigma"
     1380    stop
    13751381  endif
    13761382endif ! of if (.not.hybrid)
     
    13891395  ierr=NF90_GET_VAR(gcmfid,tmpvarid,aire)
    13901396  if (ierr.ne.nf90_noerr) then
    1391     stop "init2 Error: Failed reading aire"
     1397    write(*,*) "init2 Error: Failed reading aire"
     1398    stop
    13921399  endif
    13931400  area = .true.
     
    14071414  ierr=NF90_GET_VAR(gcmfid,tmpvarid,phisinit)
    14081415  if (ierr.ne.nf90_noerr) then
    1409     stop "init2 Error: Failed reading phisinit"
     1416    write(*,*) "init2 Error: Failed reading phisinit"
     1417    stop
    14101418  endif
    14111419  phis = .true.
     
    14261434  ierr=NF90_DEF_VAR(outfid,"aps",nf90_float,(/layerdimout/),tmpvarid)
    14271435  if (ierr.ne.nf90_noerr) then
    1428      stop "init2 Error: Failed to define the variable aps"
     1436     write(*,*) "init2 Error: Failed to define the variable aps"
     1437     stop
    14291438  endif
    14301439  ! Write the attributes
     
    14371446  ierr=NF90_PUT_VAR(outfid,tmpvarid,aps)
    14381447  if (ierr.ne.nf90_noerr) then
    1439     stop "init2 Error: Failed to write aps"
     1448    write(*,*) "init2 Error: Failed to write aps"
     1449    stop
    14401450  endif
    14411451
     
    14461456  ierr=NF90_DEF_VAR(outfid,"bps",nf90_float,(/layerdimout/),tmpvarid)
    14471457  if (ierr.ne.nf90_noerr) then
    1448      stop "init2 Error: Failed to define the variable bps"
     1458     write(*,*) "init2 Error: Failed to define the variable bps"
     1459     stop
    14491460  endif
    14501461  ! Write the attributes
     
    14571468  ierr=NF90_PUT_VAR(outfid,tmpvarid,bps)
    14581469  if (ierr.ne.nf90_noerr) then
    1459     stop "init2 Error: Failed to write bps"
     1470    write(*,*) "init2 Error: Failed to write bps"
     1471    stop
    14601472  endif
    14611473
     
    14681480    ierr=NF90_DEF_VAR(outfid,"ap",nf90_float,(/interlayerdimout/),tmpvarid)
    14691481    if (ierr.ne.nf90_noerr) then
    1470        stop "init2 Error: Failed to define the variable ap"
     1482       write(*,*) "init2 Error: Failed to define the variable ap"
     1483       stop
    14711484    endif
    14721485    ! Write the attributes
     
    14791492    ierr=NF90_PUT_VAR(outfid,tmpvarid,ap)
    14801493    if (ierr.ne.nf90_noerr) then
    1481       stop "Error: Failed to write ap"
     1494      write(*,*) "Error: Failed to write ap"
     1495      stop
    14821496    endif
    14831497
     
    14891503    ierr=NF90_DEF_VAR(outfid,"bp",nf90_float,(/interlayerdimout/),tmpvarid)
    14901504    if (ierr.ne.nf90_noerr) then
    1491        stop "init2 Error: Failed to define the variable bp"
     1505       write(*,*) "init2 Error: Failed to define the variable bp"
     1506       stop
    14921507    endif
    14931508    ! Write the attributes
     
    15001515    ierr=NF90_PUT_VAR(outfid,tmpvarid,bp)
    15011516    if (ierr.ne.nf90_noerr) then
    1502       stop "Error: Failed to write bp"
     1517      write(*,*) "Error: Failed to write bp"
     1518      stop
    15031519    endif
    15041520  endif ! of if (apbp)
     
    15111527  ierr=NF90_DEF_VAR(outfid,"sigma",nf90_float,(/layerdimout/),tmpvarid)
    15121528  if (ierr.ne.nf90_noerr) then
    1513      stop "init2 Error: Failed to define the variable sigma"
     1529     write(*,*) "init2 Error: Failed to define the variable sigma"
     1530     stop
    15141531  endif
    15151532  ! Write the attributes
     
    15221539  ierr=NF90_PUT_VAR(outfid,tmpvarid,sigma)
    15231540  if (ierr.ne.nf90_noerr) then
    1524     stop "init2 Error: Failed to write sigma"
     1541    write(*,*) "init2 Error: Failed to write sigma"
     1542    stop
    15251543  endif
    15261544endif ! of if (hybrid)
     
    15371555  ierr=NF90_DEF_VAR(outfid,"aire",nf90_float,(/londimout,latdimout/),tmpvarid)
    15381556  if (ierr.ne.nf90_noerr) then
    1539      stop "init2 Error: Failed to define the variable aire"
     1557     write(*,*) "init2 Error: Failed to define the variable aire"
     1558     stop
    15401559  endif
    15411560  ! Write the attributes
     
    15481567  ierr=NF90_PUT_VAR(outfid,tmpvarid,aire)
    15491568  if (ierr.ne.nf90_noerr) then
    1550     stop "init2 Error: Failed to write aire"
     1569    write(*,*) "init2 Error: Failed to write aire"
     1570    stop
    15511571  endif
    15521572endif ! of if (area)
     
    15591579  ierr=NF90_DEF_VAR(outfid,"phisinit",nf90_float,(/londimout,latdimout/),tmpvarid)
    15601580  if (ierr.ne.nf90_noerr) then
    1561     stop "init2 Error: Failed to define the variable phisinit"
     1581    write(*,*) "init2 Error: Failed to define the variable phisinit"
     1582    stop
    15621583  endif
    15631584  ! Write the attributes
     
    15701591  ierr=NF90_PUT_VAR(outfid,tmpvarid,phisinit)
    15711592  if (ierr.ne.nf90_noerr) then
    1572     stop "init2 Error: Failed to write phisinit"
     1593    write(*,*) "init2 Error: Failed to write phisinit"
     1594    stop
    15731595  endif
    15741596
  • trunk/LMDZ.MARS/util/concatnc.F90

    r2546 r2567  
    2828include "netcdf.inc" ! NetCDF definitions
    2929
    30 character (len=80), dimension(1000) :: file
     30character (len=100), dimension(1000) :: file
    3131! file(): input file(s) names(s)
    3232character (len=30), dimension(16) :: notconcat
    3333! notconcat(): names of the (16) variables that won't be concatenated
    34 character (len=50), dimension(:), allocatable :: var
     34character (len=100), dimension(:), allocatable :: var
    3535! var(): name(s) of variable(s) that will be concatenated
    3636character (len=100) :: tmpvar,tmpfile,long_name,units
     
    153153if(nbfile==0) then
    154154   write(*,*) "no file... game over"
    155    stop ""
     155   stop
    156156endif
    157157
     
    183183if (ierr.NE.NF_NOERR) then
    184184   write(*,*) 'ERROR: Pb opening file '//file(1)
    185    stop ""
     185   stop
    186186endif
    187187
     
    250250write(*,*) "(an empty line , i.e: just <Enter>, implies end of list)"
    251251nbvar=0
    252 read(*,'(a50)') tmpvar
     252read(*,'(a100)') tmpvar
    253253do while ((tmpvar/=' ').AND.(trim(tmpvar)/='all'))
    254254   nbvar=nbvar+1
    255255   var(nbvar)=tmpvar
    256    read(*,'(a50)') tmpvar
     256   read(*,'(a100)') tmpvar
    257257enddo
    258258
     
    287287else if(nbvar==0) then
    288288   write(*,*) "no variable... game over"
    289    stop ""
     289   stop
    290290endif ! of if (tmpvar=="all")
    291291
     
    316316         write(*,*) 'ERROR: Pb opening file '//file(i)
    317317         write(*,*) NF_STRERROR(ierr)
    318          stop ""
     318         stop
    319319      endif
    320320   endif
     
    338338   if (ierr.NE.NF_NOERR) then
    339339      write(*,*) 'ERROR: Field <latitude> or <lat> is missing in file '//file(i)
    340       stop ""
     340      stop
    341341   endif
    342342   ierr=NF_INQ_DIMLEN(nid,latdim,latlen)
     
    347347       ierr=NF_INQ_VARID(nid,"longitude",lonvar)
    348348       if (ierr.NE.NF_NOERR) then
    349           write(*,*) 'ERROR: Field <longitude> is missing in file '//file(i)
    350           stop ""
     349          write(*,*) 'ERROR: Field <longitude> is missing in file '//file(i)
     350          stop
    351351       endif
    352352       ierr=NF_INQ_DIMLEN(nid,londim,lonlen)
     
    357357       if (ierr.NE.NF_NOERR) then
    358358          write(*,*) 'ERROR: Field <lon> is missing in file '//file(i)
    359           stop ""
     359          stop
    360360       endif
    361361       ierr=NF_INQ_DIMLEN(nid,londim,lonlen)
     
    367367   if (ierr.NE.NF_NOERR) then
    368368      write(*,*) 'ERROR: Field <altitude> is missing in file '//file(i)
    369       stop ""
     369      stop
    370370   endif
    371371   ierr=NF_INQ_DIMLEN(nid,altdim,altlen)
     
    389389!==============================================================================
    390390   if (XIOS.EQ.0) then
    391         ierr=NF_INQ_DIMID(nid,"index",ctldim)
    392         if (ierr.NE.NF_NOERR) then
    393           write(*,*) 'Dimension <index> is missing in file '//file(i)
    394           write(*,*) "The program continues..."
    395           ctllen=0
    396           !stop ""
     391        ierr=NF_INQ_DIMID(nid,"index",ctldim)
     392        if (ierr.NE.NF_NOERR) then
     393          write(*,*) 'Dimension <index> is missing in file '//file(i)
     394          write(*,*) "The program continues..."
     395          ctllen=0
     396          !stop
    397397       else
    398           ierr=NF_INQ_VARID(nid,"controle",ctlvar)
    399           if (ierr.NE.NF_NOERR) then
    400             write(*,*) 'Field <controle> is missing in file '//file(i)
    401             write(*,*) "The program continues..."
    402             ctllen=0
    403             !stop ""
    404           else
     398          ierr=NF_INQ_VARID(nid,"controle",ctlvar)
     399          if (ierr.NE.NF_NOERR) then
     400            write(*,*) 'Field <controle> is missing in file '//file(i)
     401            write(*,*) "The program continues..."
     402            ctllen=0
     403            !stop
     404          else
    405405            ierr=NF_INQ_DIMLEN(nid,ctldim,ctllen)
    406           endif
     406          endif
    407407       endif
    408408   else
     
    412412       write(*,*) "The program continues..."
    413413       ctllen=0
    414        !stop ""
     414       !stop
    415415     else
    416416       ierr=NF_INQ_VARID(nid,"controle",ctlvar)
    417417       if (ierr.NE.NF_NOERR) then
    418          write(*,*) 'Field <controle> is missing in file '//file(i)
    419         write(*,*) "The program continues..."
    420          ctllen=0
    421          !stop ""
     418         write(*,*) 'Field <controle> is missing in file '//file(i)
     419          write(*,*) "The program continues..."
     420         ctllen=0
     421          !stop
    422422        else
    423          ierr=NF_INQ_DIMLEN(nid,ctldim,ctllen)
     423         ierr=NF_INQ_DIMLEN(nid,ctldim,ctllen)
    424424       endif
    425425     endif
     
    439439   if (ierr.NE.NF_NOERR) then
    440440      write(*,*) 'ERROR: Dimension <Time> is missing in file '//file(i)
    441       stop ""
     441      stop
    442442   endif
    443443   ierr=NF_INQ_VARID(nid,"Time",timevar)
    444444   if (ierr.NE.NF_NOERR) then
    445445      write(*,*) 'ERROR: Field <Time> is missing in file '//file(i)
    446       stop ""
     446      stop
    447447   endif
    448448   ierr=NF_INQ_DIMLEN(nid,timedim,timelen)
     
    452452   if (ierr.NE.NF_NOERR) then
    453453      write(*,*) 'ERROR: Dimension <time_counter> is missing in file '//file(i)
    454       stop ""
     454      stop
    455455   endif
    456456   ierr=NF_INQ_VARID(nid,"time_counter",timevar)
    457457   if (ierr.NE.NF_NOERR) then
    458458      write(*,*) 'ERROR: Field <time_counter> is missing in file '//file(i)
    459       stop ""
     459      stop
    460460   endif
    461461   ierr=NF_INQ_DIMLEN(nid,timedim,timelen)
     
    542542      if (memolatlen/=latlen) then
    543543           write(*,*) "ERROR: Not the same latitude axis"
    544            stop ""
     544           stop
    545545       else if (memolonlen/=lonlen) then
    546546           write(*,*) "ERROR: Not the same longitude axis"
    547            stop ""
     547           stop
    548548       else if (memoaltlen/=altlen) then
    549549           write(*,*) "ERROR: Not the same altitude axis"
    550            stop ""
     550           stop
    551551       else if (memoctllen/=ctllen) then
    552552           write(*,*) "ERROR: Not the same controle axis"
    553            stop ""
     553           stop
    554554       endif
    555555   endif ! of if (i==1)
     
    582582       if (rep.eq.1) write(*,*) "Sol", int(output_time) 
    583583
    584        ierr= NF_PUT_VARA_REAL(nout,timevarout,k,1,output_time)
     584       ierr= NF_PUT_VARA_REAL(nout,timevarout,(/k/),(/1/),output_time)
    585585   end do
    586586!  use the last output_time value to update memotime   
     
    602602      if (ierr.NE.NF_NOERR) then
    603603         write(*,*) 'ERROR: Field <',var(j),'> not found in file '//file(i)
    604          stop ""
     604         stop
    605605      endif
    606606      ierr=nf_inq_varndims(nid,varid,ndim)
     
    630630         corner(4)=1
    631631
    632         ! length (along dimensions) of block of data to be written
     632        ! length (along dimensions) of block of data to be written
    633633         edges(1)=timelen
    634634         edges(2)=1
     
    648648         corner(4)=1
    649649
    650         ! length (along dimensions) of block of data to be written
     650        ! length (along dimensions) of block of data to be written
    651651         edges(1)=lonlen
    652652         edges(2)=latlen
     
    667667         corner(4)=reptime+1
    668668
    669         ! length (along dimensions) of block of data to be written
     669        ! length (along dimensions) of block of data to be written
    670670         edges(1)=lonlen
    671671         edges(2)=latlen
     
    699699      if (ierr.ne.NF_NOERR) then
    700700         write(*,*) 'PUT_VAR ERROR: ',NF_STRERROR(ierr)
    701          stop ""
     701         stop
    702702      endif
    703703
     
    812812if (ierr.NE.NF_NOERR) then
    813813   WRITE(*,*)'ERROR: Impossible to create the file.'
    814    stop ""
     814   stop
    815815endif
    816816
     
    963963  hybrid=.true.
    964964  if (ierr.ne.NF_NOERR) then
    965     stop "init2 Error: Failed reading aps"
     965    write(*,*) "init2 Error: Failed reading aps"
     966    stop
    966967  endif
    967968
     
    975976  ierr=NF_INQ_VARID(infid,"bps",tmpvarid)
    976977  if (ierr.ne.NF_NOERR) then
    977     stop "init2 Error: Failed to get bps ID."
     978    write(*,*) "init2 Error: Failed to get bps ID."
     979    stop
    978980  endif
    979981  ierr=NF_GET_VAR_REAL(infid,tmpvarid,bps)
    980982  if (ierr.ne.NF_NOERR) then
    981     stop "init2 Error: Failed reading bps"
     983    write(*,*) "init2 Error: Failed reading bps"
     984    stop
    982985  endif
    983986endif
     
    9971000  apbp=.true.
    9981001  if (ierr.ne.NF_NOERR) then
    999     stop "Error: Failed reading ap"
     1002    write(*,*) "Error: Failed reading ap"
     1003    stop
    10001004  endif
    10011005endif
     
    10151019  apbp=.true.
    10161020  if (ierr.ne.NF_NOERR) then
    1017     stop "Error: Failed reading bp"
     1021    write(*,*) "Error: Failed reading bp"
     1022    stop
    10181023  endif
    10191024endif
     
    10341039    sig=.true.
    10351040    if (ierr.ne.NF_NOERR) then
    1036       stop "init2 Error: Failed reading sigma"
     1041      write(*,*) "init2 Error: Failed reading sigma"
     1042      stop
    10371043    endif
    10381044  endif
     
    10521058  ierr=NF_GET_VAR_REAL(infid,tmpvarid,aire)
    10531059  if (ierr.ne.NF_NOERR) then
    1054     stop "init2 Error: Failed reading aire"
     1060    write(*,*) "init2 Error: Failed reading aire"
     1061    stop
    10551062  endif
    10561063  area = .true.
     
    10701077  ierr=NF_GET_VAR_REAL(infid,tmpvarid,phisinit)
    10711078  if (ierr.ne.NF_NOERR) then
    1072     stop "init2 Error: Failed reading phisinit"
     1079    write(*,*) "init2 Error: Failed reading phisinit"
     1080    stop
    10731081  endif
    10741082  phis = .true.
     
    10871095             (/layerdimout/),apsid,ierr)
    10881096  if (ierr.ne.NF_NOERR) then
    1089     stop "init2 Error: Failed to def_var aps"
     1097    write(*,*) "init2 Error: Failed to def_var aps"
     1098    stop
    10901099  endif
    10911100
     
    10931102  ierr=NF_PUT_VAR_REAL(outfid,apsid,aps)
    10941103  if (ierr.ne.NF_NOERR) then
    1095     stop "init2 Error: Failed to write aps"
     1104    write(*,*) "init2 Error: Failed to write aps"
     1105    stop
    10961106  endif
    10971107
     
    11001110             (/layerdimout/),bpsid,ierr)
    11011111  if (ierr.ne.NF_NOERR) then
    1102     stop "init2 Error: Failed to def_var bps"
     1112    write(*,*) "init2 Error: Failed to def_var bps"
     1113    stop
    11031114  endif
    11041115
     
    11061117  ierr=NF_PUT_VAR_REAL(outfid,bpsid,bps)
    11071118  if (ierr.ne.NF_NOERR) then
    1108     stop "init2 Error: Failed to write bps"
     1119    write(*,*) "init2 Error: Failed to write bps"
     1120    stop
    11091121  endif
    11101122
     
    11141126             (/interlayerdimout/),apid,ierr)
    11151127    if (ierr.ne.NF_NOERR) then
    1116       stop "Error: Failed to def_var ap"
     1128      write(*,*) "Error: Failed to def_var ap"
     1129      stop
    11171130    endif
    11181131
     
    11201133    ierr=NF_PUT_VAR_REAL(outfid,apid,ap)
    11211134    if (ierr.ne.NF_NOERR) then
    1122       stop "Error: Failed to write ap"
     1135      write(*,*) "Error: Failed to write ap"
     1136      stop
    11231137    endif
    11241138
     
    11271141             (/interlayerdimout/),bpid,ierr)
    11281142    if (ierr.ne.NF_NOERR) then
    1129       stop "Error: Failed to def_var bp"
     1143      write(*,*) "Error: Failed to def_var bp"
     1144      stop
    11301145    endif
    11311146
     
    11331148    ierr=NF_PUT_VAR_REAL(outfid,bpid,bp)
    11341149    if (ierr.ne.NF_NOERR) then
    1135       stop "Error: Failed to write bp"
     1150      write(*,*) "Error: Failed to write bp"
     1151      stop
    11361152    endif
    11371153  endif ! of if (apbp)
     
    11421158             (/layerdimout/),sigmaid,ierr)
    11431159  if (ierr.ne.NF_NOERR) then
    1144     stop "init2 Error: Failed to def_var sigma"
     1160    write(*,*) "init2 Error: Failed to def_var sigma"
     1161    stop
    11451162  endif
    11461163! write sigma
    11471164  ierr=NF_PUT_VAR_REAL(outfid,sigmaid,sigma)
    11481165  if (ierr.ne.NF_NOERR) then
    1149     stop "init2 Error: Failed to write sigma"
     1166    write(*,*) "init2 Error: Failed to write sigma"
     1167    stop
    11501168  endif
    11511169endif ! of if (hybrid)
     
    11601178           (/londimout,latdimout/),tmpvarid,ierr)
    11611179  if (ierr.ne.NF_NOERR) then
    1162      stop "init2 Error: Failed to def_var aire"
     1180     write(*,*) "init2 Error: Failed to def_var aire"
     1181     stop
    11631182  endif
    11641183 
     
    11661185  ierr=NF_PUT_VAR_REAL(outfid,tmpvarid,aire)
    11671186  if (ierr.ne.NF_NOERR) then
    1168     stop "init2 Error: Failed to write aire"
     1187    write(*,*) "init2 Error: Failed to write aire"
     1188    stop
    11691189  endif
    11701190endif ! of if (area)
     
    11761196            (/londimout,latdimout/),phisinitid,ierr)
    11771197   if (ierr.ne.NF_NOERR) then
    1178      stop "init2 Error: Failed to def_var phisinit"
     1198     write(*,*) "init2 Error: Failed to def_var phisinit"
     1199     stop
    11791200   endif
    11801201
     
    11821203  ierr=NF_PUT_VAR_REAL(outfid,phisinitid,phisinit)
    11831204  if (ierr.ne.NF_NOERR) then
    1184     stop "init2 Error: Failed to write phisinit"
     1205    write(*,*) "init2 Error: Failed to write phisinit"
     1206    stop
    11851207  endif
    11861208
     
    12961318   write(*,*) 'ERROR in change_time_axis: Field <Time> not found'
    12971319   print*, NF_STRERROR(ierr)
    1298    stop ""
     1320   stop
    12991321endif
    13001322
     
    14941516   !write(*,*) 'NF_NOERR', NF_NOERR
    14951517   !CALL abort
    1496    stop ""
     1518   stop
    14971519endif
    14981520
     
    15051527!    WRITE(*,*) 'NF_NOERR', NF_NOERR
    15061528!    CALL abort
    1507    stop ""
     1529   stop
    15081530endif
    15091531
  • trunk/LMDZ.MARS/util/hrecast.F90

    r2140 r2567  
    116116if (ierr.ne.NF_NOERR) then
    117117   write(*,*) 'ERROR: Pb opening file ',trim(infile)
    118    stop ""
     118   stop
    119119endif
    120120
     
    189189  write(*,*) 'No variables to process !?'
    190190  write(*,*) 'Might as well stop here'
    191   stop ""
     191  stop
    192192else
    193193  write(*,*) ""
     
    209209ierr=NF_INQ_DIMID(infid,"latitude",tmpdimid)
    210210if (ierr.ne.NF_NOERR) then
    211   stop "Error: Failed to get latitude dimension ID"
     211  write(*,*) "Error: Failed to get latitude dimension ID"
     212  stop
    212213else
    213214  ierr=NF_INQ_VARID(infid,"latitude",tmpvarid)
    214215  if (ierr.ne.NF_NOERR) then
    215     stop "Error: Failed to get latitude ID"
     216    write(*,*) "Error: Failed to get latitude ID"
     217    stop
    216218  else
    217219    ierr=NF_INQ_DIMLEN(infid,tmpdimid,inlatlength)
    218220    if (ierr.ne.NF_NOERR) then
    219       stop "Error: Failed to get latitude length"
     221      write(*,*) "Error: Failed to get latitude length"
     222      stop
    220223    else
    221224      allocate(inlat(inlatlength))
    222225      ierr=NF_GET_VAR_REAL(infid,tmpvarid,inlat)
    223226      if (ierr.ne.NF_NOERR) then
    224         stop "Error: Failed reading latitude"
     227        write(*,*) "Error: Failed reading latitude"
     228        stop
    225229      endif
    226230    endif
     
    244248ierr=NF_INQ_DIMID(infid,"longitude",tmpdimid)
    245249if (ierr.ne.NF_NOERR) then
    246   stop "Error: Failed to get longitude dimension ID"
     250  write(*,*) "Error: Failed to get longitude dimension ID"
     251  stop
    247252else
    248253  ierr=NF_INQ_VARID(infid,"longitude",tmpvarid)
    249254  if (ierr.ne.NF_NOERR) then
    250     stop "Error: Failed to get longitude ID"
     255    write(*,*) "Error: Failed to get longitude ID"
     256    stop
    251257  else
    252258    ierr=NF_INQ_DIMLEN(infid,tmpdimid,inlonlength)
    253259    if (ierr.ne.NF_NOERR) then
    254       stop "Error: Failed to get longitude length"
     260      write(*,*) "Error: Failed to get longitude length"
     261      stop
    255262    else
    256263      allocate(inlon(inlonlength))
    257264      ierr=NF_GET_VAR_REAL(infid,tmpvarid,inlon)
    258265      if (ierr.ne.NF_NOERR) then
    259         stop "Error: Failed reading longitude"
     266        write(*,*) "Error: Failed reading longitude"
     267        stop
    260268      endif
    261269    endif
     
    279287ierr=NF_INQ_DIMID(infid,"altitude",tmpdimid)
    280288if (ierr.ne.NF_NOERR) then
    281   stop "Error: Failed to get altitude dimension ID"
     289  write(*,*) "Error: Failed to get altitude dimension ID"
     290  stop
    282291else
    283292  ierr=NF_INQ_VARID(infid,"altitude",tmpvarid)
    284293  if (ierr.ne.NF_NOERR) then
    285     stop "Error: Failed to get altitude ID"
     294    write(*,*) "Error: Failed to get altitude ID"
     295    stop
    286296  else
    287297    ierr=NF_INQ_DIMLEN(infid,tmpdimid,altlength)
    288298    if (ierr.ne.NF_NOERR) then
    289       stop "Error: Failed to get altitude length"
     299      write(*,*) "Error: Failed to get altitude length"
     300      stop
    290301    else
    291302      allocate(alt(altlength))
    292303      ierr=NF_GET_VAR_REAL(infid,tmpvarid,alt)
    293304      if (ierr.ne.NF_NOERR) then
    294         stop "Error: Failed reading altitude"
     305        write(*,*) "Error: Failed reading altitude"
     306        stop
    295307      endif
    296308    endif
     
    301313ierr=NF_INQ_DIMID(infid,"Time",tmpdimid)
    302314if (ierr.ne.NF_NOERR) then
    303   stop "Error: Failed to get Time dimension ID"
     315  write(*,*) "Error: Failed to get Time dimension ID"
     316  stop
    304317else
    305318  ierr=NF_INQ_VARID(infid,"Time",tmpvarid)
    306319  if (ierr.ne.NF_NOERR) then
    307     stop "Error: Failed to get Time ID"
     320    write(*,*) "Error: Failed to get Time ID"
     321    stop
    308322  else
    309323    ierr=NF_INQ_DIMLEN(infid,tmpdimid,timelength)
    310324    if (ierr.ne.NF_NOERR) then
    311       stop "Error: Failed to get Time length"
     325      write(*,*) "Error: Failed to get Time length"
     326      stop
    312327    else
    313328      allocate(time(timelength))
    314329      ierr=NF_GET_VAR_REAL(infid,tmpvarid,time)
    315330      if (ierr.ne.NF_NOERR) then
    316         stop "Error: Failed reading Time"
     331        write(*,*) "Error: Failed reading Time"
     332        stop
    317333      endif
    318334    endif
     
    332348  ierr=NF_GET_VAR_REAL(infid,tmpvarid,sigma)
    333349  if (ierr.ne.NF_NOERR) then
    334     stop "Error: Failed reading sigma"
     350    write(*,*) "Error: Failed reading sigma"
     351    stop
    335352  endif
    336353endif
     
    341358  ierr=NF_INQ_VARID(infid,"aps",tmpvarid)
    342359  if (ierr.ne.NF_NOERR) then
    343     stop "Error: Failed to get aps ID"
     360    write(*,*) "Error: Failed to get aps ID"
     361    stop
    344362  else
    345363    allocate(aps(altlength))
    346364    ierr=NF_GET_VAR_REAL(infid,tmpvarid,aps)
    347365    if (ierr.ne.NF_NOERR) then
    348       stop "Error: Failed reading aps"
     366      write(*,*) "Error: Failed reading aps"
     367      stop
    349368    endif
    350369  endif
     
    353372  ierr=NF_INQ_VARID(infid,"bps",tmpvarid)
    354373  if (ierr.ne.NF_NOERR) then
    355     stop "Error: Failed to get bps ID"
     374    write(*,*) "Error: Failed to get bps ID"
     375    stop
    356376  else
    357377    allocate(bps(altlength))
    358378    ierr=NF_GET_VAR_REAL(infid,tmpvarid,bps)
    359379    if (ierr.ne.NF_NOERR) then
    360       stop "Error: Failed reading bps"
     380      write(*,*) "Error: Failed reading bps"
     381      stop
    361382    endif
    362383  endif
     
    377398  ierr=NF_GET_VAR_REAL(infid,tmpvarid,inphisinit)
    378399  if (ierr.ne.NF_NOERR) then
    379     stop "Error: Failed reading phisinit"
     400    write(*,*) "Error: Failed reading phisinit"
     401    stop
    380402  endif
    381403endif
     
    525547ierr=NF_DEF_DIM(outfid,"longitude",lonlength,lon_dimid)
    526548if (ierr.ne.NF_NOERR) then
    527   stop "Error: Could not define longitude dimension"
     549  write(*,*) "Error: Could not define longitude dimension"
     550  stop
    528551endif
    529552
     
    531554ierr=NF_DEF_DIM(outfid,"latitude",latlength,lat_dimid)
    532555if (ierr.ne.NF_NOERR) then
    533   stop "Error: Could not define latitude dimension"
     556  write(*,*) "Error: Could not define latitude dimension"
     557  stop
    534558endif
    535559
     
    537561ierr=NF_DEF_DIM(outfid,"altitude",altlength,alt_dimid)
    538562if (ierr.ne.NF_NOERR) then
    539   stop "Error: Could not define altitude dimension"
     563  write(*,*) "Error: Could not define altitude dimension"
     564  stop
    540565endif
    541566
     
    543568ierr=NF_DEF_DIM(outfid,"Time",NF_UNLIMITED,time_dimid)
    544569if (ierr.ne.NF_NOERR) then
    545   stop "Error: Could not define latitude dimension"
     570  write(*,*) "Error: Could not define latitude dimension"
     571  stop
    546572endif
    547573
     
    556582ierr=NF_DEF_VAR(outfid,"longitude",NF_REAL,1,datashape(1),lon_varid)
    557583if (ierr.ne.NF_NOERR) then
    558   stop "Error: Could not define longitude variable"
     584  write(*,*) "Error: Could not define longitude variable"
     585  stop
    559586endif
    560587
     
    563590ierr=NF_PUT_ATT_TEXT(outfid,lon_varid,'long_name',len_trim(text),text)
    564591if (ierr.ne.NF_NOERR) then
    565   stop "Error: Problem writing long_name for longitude"
     592  write(*,*) "Error: Problem writing long_name for longitude"
     593  stop
    566594endif
    567595text='degrees_east'
    568596ierr=NF_PUT_ATT_TEXT(outfid,lon_varid,'units',len_trim(text),text)
    569597if (ierr.ne.NF_NOERR) then
    570   stop "Error: Problem writing units for longitude"
     598  write(*,*) "Error: Problem writing units for longitude"
     599  stop
    571600endif
    572601
     
    575604ierr=NF_DEF_VAR(outfid,"latitude",NF_REAL,1,datashape(2),lat_varid)
    576605if (ierr.ne.NF_NOERR) then
    577   stop "Error: Could not define latitude variable"
     606  write(*,*) "Error: Could not define latitude variable"
     607  stop
    578608endif
    579609
     
    582612ierr=NF_PUT_ATT_TEXT(outfid,lat_varid,'long_name',len_trim(text),text)
    583613if (ierr.ne.NF_NOERR) then
    584   stop "Error: Problem writing long_name for latitude"
     614  write(*,*) "Error: Problem writing long_name for latitude"
     615  stop
    585616endif
    586617text='degrees_north'
    587618ierr=NF_PUT_ATT_TEXT(outfid,lat_varid,'units',len_trim(text),text)
    588619if (ierr.ne.NF_NOERR) then
    589   stop "Error: Problem writing units for latitude"
     620  write(*,*) "Error: Problem writing units for latitude"
     621  stop
    590622endif
    591623
     
    594626ierr=NF_DEF_VAR(outfid,"altitude",NF_REAL,1,datashape(3),alt_varid)
    595627if (ierr.ne.NF_NOERR) then
    596   stop "Error: Could not define altitude variable"
     628  write(*,*) "Error: Could not define altitude variable"
     629  stop
    597630endif
    598631
     
    629662  ierr=NF_DEF_VAR(outfid,"sigma",NF_REAL,1,alt_dimid,sigma_varid)
    630663  if (ierr.ne.NF_NOERR) then
    631     stop "Error: Could not define sigma variable"
     664    write(*,*) "Error: Could not define sigma variable"
     665    stop
    632666  endif
    633667else ! hybrid coordinates
    634668  ierr=NF_DEF_VAR(outfid,"aps",NF_REAL,1,alt_dimid,aps_varid)
    635669  if (ierr.ne.NF_NOERR) then
    636     stop "Error: Could not define aps variable"
     670    write(*,*) "Error: Could not define aps variable"
     671    stop
    637672  endif
    638673  ierr=NF_DEF_VAR(outfid,"bps",NF_REAL,1,alt_dimid,bps_varid)
    639674  if (ierr.ne.NF_NOERR) then
    640     stop "Error: Could not define bps variable"
     675    write(*,*) "Error: Could not define bps variable"
     676    stop
    641677  endif
    642678endif
     
    647683  ierr=NF_PUT_ATT_TEXT(outfid,sigma_varid,'long_name',len_trim(text),text)
    648684  if (ierr.ne.NF_NOERR) then
    649     stop "Error: Problem writing long_name for sigma"
     685    write(*,*) "Error: Problem writing long_name for sigma"
     686    stop
    650687  endif
    651688else ! hybrid coordinates
     
    653690  ierr=NF_PUT_ATT_TEXT(outfid,aps_varid,'long_name',len_trim(text),text)
    654691  if (ierr.ne.NF_NOERR) then
    655     stop "Error: Problem writing long_name for aps"
     692    write(*,*) "Error: Problem writing long_name for aps"
     693    stop
    656694  endif
    657695  text="hybrid sigma at midlayers"
    658696  ierr=NF_PUT_ATT_TEXT(outfid,bps_varid,'long_name',len_trim(text),text)
    659697  if (ierr.ne.NF_NOERR) then
    660     stop "Error: Problem writing long_name for bps"
     698    write(*,*) "Error: Problem writing long_name for bps"
     699    stop
    661700  endif
    662701endif ! of if (have_sigma)
     
    666705ierr=NF_DEF_VAR(outfid,"Time",NF_REAL,1,datashape(4),time_varid)
    667706if (ierr.ne.NF_NOERR) then
    668   stop "Error: Could not define Time variable"
     707  write(*,*) "Error: Could not define Time variable"
     708  stop
    669709endif
    670710
     
    683723  ierr=NF_PUT_ATT_TEXT(outfid,time_varid,'units',len_trim(text),text)
    684724  if (ierr.ne.NF_NOERR) then
    685     stop "Error: Problem writing units for Time"
     725    write(*,*) "Error: Problem writing units for Time"
     726    stop
    686727  endif
    687728endif
     
    694735    ierr=NF_DEF_VAR(outfid,"phisinit",NF_REAL,2,datashape,phisinit_varid)
    695736    if (ierr.ne.NF_NOERR) then
    696       stop "Error: Could not define phisinit variable"
     737      write(*,*) "Error: Could not define phisinit variable"
     738      stop
    697739    endif
    698740  endif
     
    701743  ierr=NF_PUT_ATT_TEXT(outfid,phisinit_varid,'long_name',len_trim(text),text)
    702744  if (ierr.ne.NF_NOERR) then
    703     stop "Error: Problem writing long_name for phisinit"
     745    write(*,*) "Error: Problem writing long_name for phisinit"
     746    stop
    704747  endif
    705748endif ! of if (have_geopot)
     
    714757  if (ierr.ne.NF_NOERR) then
    715758    write(*,*) 'Error, failed to get ID for input variable ',trim(var(i))
    716     stop ""
     759    stop
    717760  endif
    718761 
     
    738781  if (ierr.ne.NF_NOERR) then
    739782    write(*,*) 'Error, could not define variable ',trim(var(i))
    740     stop ""
     783    stop
    741784  endif
    742785 
     
    747790    write(*,*) 'Error, could not get number of attributes for variable ',&
    748791               trim(var(i))
    749     stop ""
     792    stop
    750793  endif
    751794  ! inititialize j == number of attributes written to output
     
    766809      if (ierr.ne.NF_NOERR) then
    767810        write(*,*) "Error failed to copy title attribute:",trim(text)
    768       stop ""
     811        stop
    769812      endif
    770813    endif
     
    775818    if (ierr.ne.NF_NOERR) then
    776819      write(*,*) "Error failed to copy long_name attribute:",trim(text)
    777       stop ""
     820      stop
    778821    endif
    779822  endif
     
    789832    if (ierr.ne.NF_NOERR) then
    790833      write(*,*) "Error failed to copy units attribute:",trim(text)
    791       stop ""
     834      stop
    792835    endif
    793836  endif
     
    805848  ierr=NF_PUT_ATT_REAL(outfid,var_id(i),'missing_value',NF_REAL,1,miss_val)
    806849  if (ierr.ne.NF_NOERR) then
    807     stop "Error, failed to write missing_value attribute"
     850    write(*,*) "Error, failed to write missing_value attribute"
     851    stop
    808852  endif
    809853 
     
    823867ierr=NF_ENDDEF(outfid)
    824868if (ierr.ne.NF_NOERR) then
    825   stop "Error: Could not switch out of define mode"
     869  write(*,*) "Error: Could not switch out of define mode"
     870  stop
    826871endif
    827872
     
    829874ierr=NF_PUT_VAR_REAL(outfid,lon_varid,lon)
    830875if (ierr.ne.NF_NOERR) then
    831   stop "Error: Could not write longitude data to output file"
     876  write(*,*) "Error: Could not write longitude data to output file"
     877  stop
    832878endif
    833879
     
    835881ierr=NF_PUT_VAR_REAL(outfid,lat_varid,lat)
    836882if (ierr.ne.NF_NOERR) then
    837   stop "Error: Could not write latitude data to output file"
     883  write(*,*) "Error: Could not write latitude data to output file"
     884  stop
    838885endif
    839886
     
    841888ierr=NF_PUT_VAR_REAL(outfid,alt_varid,alt)
    842889if (ierr.ne.NF_NOERR) then
    843   stop "Error: Could not write altitude data to output file"
     890  write(*,*) "Error: Could not write altitude data to output file"
     891  stop
    844892endif
    845893
     
    848896  ierr=NF_PUT_VAR_REAL(outfid,sigma_varid,sigma)
    849897  if (ierr.ne.NF_NOERR) then
    850     stop "Error: Could not write sigma data to output file"
     898    write(*,*) "Error: Could not write sigma data to output file"
     899    stop
    851900  endif
    852901else ! hybrid coordinates
    853902  ierr=NF_PUT_VAR_REAL(outfid,aps_varid,aps)
    854903  if (ierr.ne.NF_NOERR) then
    855     stop "Error: Could not write aps data to output file"
     904    write(*,*) "Error: Could not write aps data to output file"
     905    stop
    856906  endif
    857907  ierr=NF_PUT_VAR_REAL(outfid,bps_varid,bps)
    858908  if (ierr.ne.NF_NOERR) then
    859     stop "Error: Could not write bps data to output file"
     909    write(*,*) "Error: Could not write bps data to output file"
     910    stop
    860911  endif
    861912endif
    862913
    863914! write time
    864 ierr=NF_PUT_VARA_REAL(outfid,time_varid,1,timelength,time)
    865 if (ierr.ne.NF_NOERR) then
    866   stop "Error: Could not write Time data to output file"
     915ierr=NF_PUT_VARA_REAL(outfid,time_varid,(/1/),(/timelength/),time)
     916if (ierr.ne.NF_NOERR) then
     917  write(*,*) "Error: Could not write Time data to output file"
     918  stop
    867919endif
    868920
     
    880932  ierr=NF_INQ_VARID(infid,"phisinit",tmpvarid)
    881933  if (ierr.ne.NF_NOERR) then
    882     stop "Error: Failed to get phisinit ID"
     934    write(*,*) "Error: Failed to get phisinit ID"
     935    stop
    883936  endif
    884937  ! Get physinit
    885938  ierr=NF_GET_VAR_REAL(infid,tmpvarid,in_2d_data)
    886939  if (ierr.ne.NF_NOERR) then
    887     stop "Error: Failed reading input phisinit"
     940    write(*,*) "Error: Failed reading input phisinit"
     941    stop
    888942  endif
    889943 
     
    903957  ierr=NF_PUT_VAR_REAL(outfid,phisinit_varid,out_2d_data)
    904958  if (ierr.ne.NF_NOERR) then
    905     stop "Error: Could not write phisinit data to output file"
     959    write(*,*) "Error: Could not write phisinit data to output file"
     960    stop
    906961  endif
    907962endif ! of if (have_geopot)
     
    10731128
    10741129       REAL airen ((imnmx2+1)*(jmnmx2+1)) ! aire dans la nouvelle grille
    1075        REAL airentotn   ! aire totale pole nord dans la nouvelle grille
    1076        REAL airentots   ! aire totale pole sud dans la nouvelle grille
     1130       REAL airentotn   ! aire totale pole nord dans la nouvelle grille
     1131       REAL airentots   ! aire totale pole sud dans la nouvelle grille
    10771132!    Info sur les ktotal intersection entre les cases new/old grille
    10781133
  • trunk/LMDZ.MARS/util/localtime.F90

    r2546 r2567  
    1212include "netcdf.inc" ! NetCDF definitions
    1313
    14 character (len=50)  file
     14character (len=100)  file
    1515! file(): input file(s) names(s)
    1616character (len=30), dimension(16) :: notprocessed
    1717! notprocessed(): names of the (16) variables that won't be processed
    18 character (len=50), dimension(:), allocatable :: var
     18character (len=100), dimension(:), allocatable :: var
    1919! var(): name(s) of variable(s) that will be processed
    2020character (len=100) :: tmpvar,long_name,units
     
    121121if (len_trim(file).eq.0) then
    122122   write(*,*) "no file... game over"
    123    stop ""
     123   stop
    124124endif
    125125
     
    132132   write(*,*) 'ERROR: Pb opening file '//trim(file)
    133133   write(*,*) NF_STRERROR(ierr)
    134    stop ""
     134   stop
    135135endif
    136136
     
    140140   write(*,*) 'ERROR: Pb with NF_INQ_NVARS'
    141141   write(*,*) NF_STRERROR(ierr)
    142    stop ""
     142   stop
    143143endif
    144144
     
    199199write(*,*) "(an empty line , i.e: just <Enter>, implies end of list)"
    200200nbvar=0
    201 read(*,'(a50)') tmpvar
     201read(*,'(a100)') tmpvar
    202202do while ((tmpvar/=' ').AND.(trim(tmpvar)/='all'))
    203203   nbvar=nbvar+1
    204204   var(nbvar)=tmpvar
    205    read(*,'(a50)') tmpvar
     205   read(*,'(a100)') tmpvar
    206206enddo
    207207
     
    219219else if(nbvar==0) then
    220220   write(*,*) "no variable... game over"
    221    stop ""
     221   stop
    222222endif ! of if (tmpvar=="all")
    223223
     
    238238      write(*,*) 'ERROR: Pb opening file '//trim(file)
    239239      write(*,*) NF_STRERROR(ierr)
    240       stop ""
     240      stop
    241241   endif
    242242
     
    251251         if (ierr.NE.NF_NOERR) then
    252252            write(*,*) 'ERROR: Dimension <latitude> and <lat> is missing in file '//trim(file)
    253             stop ""
     253            stop
    254254         endif
    255255   endif
     
    260260      if (ierr.NE.NF_NOERR) then
    261261        write(*,*) 'ERROR: Field <latitude> and <lat> is missing in file '//trim(file)
    262         stop ""
     262        stop
    263263      endif
    264264   endif
     
    272272         if (ierr.NE.NF_NOERR) then
    273273            write(*,*) 'ERROR: Dimension <longitude> and <lon> is missing in file '//trim(file)
    274             stop ""
     274            stop
    275275         endif
    276276   endif
     
    281281      if (ierr.NE.NF_NOERR) then
    282282        write(*,*) 'ERROR: Field <longitude> and <lon> is missing in file '//trim(file)
    283         stop ""
     283        stop
    284284      endif
    285285   endif
     
    290290   if (ierr.NE.NF_NOERR) then
    291291      write(*,*) 'ERROR: Dimension <altitude> is missing in file '//trim(file)
    292       stop ""
     292      stop
    293293   endif
    294294   ierr=NF_INQ_VARID(nid,"altitude",altvar)
    295295   if (ierr.NE.NF_NOERR) then
    296296      write(*,*) 'ERROR: Field <altitude> is missing in file '//trim(file)
    297       stop ""
     297      stop
    298298   endif
    299299   ierr=NF_INQ_DIMLEN(nid,altdim,altlen)
     
    321321         ctllen=0
    322322      endif
    323       !stop ""
     323      !stop
    324324   endif
    325325!   ierr=NF_INQ_DIMID(nid,"controle_axe",ctldim)
    326326!   if (ierr.NE.NF_NOERR) then
    327 !      !stop ""
     327!      !stop
    328328!   endif
    329329   ierr=NF_INQ_VARID(nid,"controle",ctlvar)
     
    331331      write(*,*) 'Field <controle> is missing in file '//trim(file)
    332332      ctllen=0
    333       !stop ""
     333      !stop
    334334   else
    335335      ierr=NF_INQ_DIMLEN(nid,ctldim,ctllen)
     
    414414     if (ierr.NE.NF_NOERR) then
    415415        write(*,*) 'ERROR: Dimension <Time> or is missing in file'//trim(file)
    416         stop ""
     416        stop
    417417     endif
    418418   endif
     
    423423     if (ierr.NE.NF_NOERR) then
    424424        write(*,*) 'ERROR: Field <Time> is missing in file '//trim(file)
    425         stop ""
     425        stop
    426426     endif
    427427   endif
     
    556556
    557557     do it=1,timelen_lt
    558         ierr= NF_PUT_VARA_REAL(nout,timevarout,it,1,lt_hour(it))
     558        ierr= NF_PUT_VARA_REAL(nout,timevarout,(/it/),(/1/),lt_hour(it))
    559559     enddo
    560560   else
    561561     do it=1,timelen_lt
    562         ierr= NF_PUT_VARA_REAL(nout,timevarout,it,1,lt_out(it))
     562        ierr= NF_PUT_VARA_REAL(nout,timevarout,(/it/),(/1/),lt_out(it))
    563563        if (ierr.NE.NF_NOERR) then
    564564          write(*,*) "Error , failed to write Time"
     
    582582      if (ierr.NE.NF_NOERR) then
    583583         write(*,*) 'ERROR: Field <',var(j),'> not found in file'//file
    584          stop ""
     584         stop
    585585      endif
    586586      ierr=nf_inq_varndims(nid,varid,ndim)
     
    718718      if (ierr.ne.NF_NOERR) then
    719719         write(*,*) 'PUT_VAR ERROR: ',NF_STRERROR(ierr)
    720          stop ""
     720         stop
    721721      endif
    722722
     
    820820   WRITE(*,*)'ERROR: Impossible to create the file ',trim(filename)
    821821   write(*,*) NF_STRERROR(ierr)
    822    stop ""
     822   stop
    823823endif
    824824
     
    831831   WRITE(*,*)'initiate: error failed to define dimension <latitude>'
    832832   write(*,*) NF_STRERROR(ierr)
    833    stop ""
     833   stop
    834834endif
    835835ierr = NF_DEF_DIM(nout, "longitude", lonlen, londimout)
     
    837837   WRITE(*,*)'initiate: error failed to define dimension <longitude>'
    838838   write(*,*) NF_STRERROR(ierr)
    839    stop ""
     839   stop
    840840endif
    841841ierr = NF_DEF_DIM(nout, "altitude", altlen, altdimout)
     
    843843   WRITE(*,*)'initiate: error failed to define dimension <altitude>'
    844844   write(*,*) NF_STRERROR(ierr)
    845    stop ""
     845   stop
    846846endif
    847847if (size(ctl).ne.0) then
     
    850850    WRITE(*,*)'initiate: error failed to define dimension <index>'
    851851    write(*,*) NF_STRERROR(ierr)
    852     stop ""
     852    stop
    853853  endif
    854854endif
     
    857857   WRITE(*,*)'initiate: error failed to define dimension <Time>'
    858858   write(*,*) NF_STRERROR(ierr)
    859    stop ""
     859   stop
    860860endif
    861861
     
    867867   WRITE(*,*)'initiate: error failed to switch out of define mode'
    868868   write(*,*) NF_STRERROR(ierr)
    869    stop ""
     869   stop
    870870endif
    871871
     
    888888   WRITE(*,*)'initiate: error failed writing variable <latitude>'
    889889   write(*,*) NF_STRERROR(ierr)
    890    stop ""
     890   stop
    891891endif
    892892
     
    903903   WRITE(*,*)'initiate: error failed writing variable <longitude>'
    904904   write(*,*) NF_STRERROR(ierr)
    905    stop ""
     905   stop
    906906endif
    907907
     
    926926   WRITE(*,*)'initiate: error failed writing variable <altitude>'
    927927   write(*,*) NF_STRERROR(ierr)
    928    stop ""
     928   stop
    929929endif
    930930
     
    948948      WRITE(*,*)'initiate: error failed writing variable <controle>'
    949949      write(*,*) NF_STRERROR(ierr)
    950       stop ""
     950      stop
    951951   endif
    952952endif
     
    10141014  hybrid=.true.
    10151015  if (ierr.ne.NF_NOERR) then
    1016     stop "init2 Error: Failed reading aps"
     1016    write(*,*) "init2 Error: Failed reading aps"
     1017    stop
    10171018  endif
    10181019
     
    10311032    ierr=NF_GET_VAR_REAL(infid,tmpvarid,bps)
    10321033    if (ierr.ne.NF_NOERR) then
    1033       stop "init2 Error: Failed reading bps"
     1034      write(*,*) "init2 Error: Failed reading bps"
     1035      stop
    10341036    endif
    10351037  endif
     
    10501052  ierr=NF_GET_VAR_REAL(infid,tmpvarid,phisinit)
    10511053  if (ierr.ne.NF_NOERR) then
    1052     stop "init2 Error: Failed reading phisinit"
     1054    write(*,*) "init2 Error: Failed reading phisinit"
     1055    stop
    10531056  endif
    10541057  phis = .true.
     
    10691072               (/layerdimout/),apsid,ierr)
    10701073  if (ierr.ne.NF_NOERR) then
    1071     stop "Error: Failed to def_var aps"
     1074    write(*,*) "Error: Failed to def_var aps"
     1075    stop
    10721076  endif
    10731077
     
    10751079  ierr=NF_PUT_VAR_REAL(outfid,apsid,aps)
    10761080  if (ierr.ne.NF_NOERR) then
    1077     stop "Error: Failed to write aps"
     1081    write(*,*) "Error: Failed to write aps"
     1082    stop
    10781083  endif
    10791084 
     
    10821087               (/layerdimout/),bpsid,ierr)
    10831088  if (ierr.ne.NF_NOERR) then
    1084     stop "Error: Failed to def_var bps"
     1089    write(*,*) "Error: Failed to def_var bps"
     1090    stop
    10851091  endif
    10861092
     
    10881094  ierr=NF_PUT_VAR_REAL(outfid,bpsid,bps)
    10891095  if (ierr.ne.NF_NOERR) then
    1090     stop "Error: Failed to write bps"
     1096    write(*,*) "Error: Failed to write bps"
     1097    stop
    10911098  endif
    10921099 
     
    11051112              (/londimout,latdimout/),phisinitid,ierr)
    11061113  if (ierr.ne.NF_NOERR) then
    1107      stop "Error: Failed to def_var phisinit"
     1114     write(*,*) "Error: Failed to def_var phisinit"
     1115     stop
    11081116  endif
    11091117
     
    11111119  ierr=NF_PUT_VAR_REAL(outfid,phisinitid,phisinit)
    11121120  if (ierr.ne.NF_NOERR) then
    1113     stop "Error: Failed to write phisinit"
     1121    write(*,*) "Error: Failed to write phisinit"
     1122    stop
    11141123  endif
    11151124
     
    12261235     !write(*,*) 'NF_NOERR', NF_NOERR
    12271236     !CALL abort
    1228      stop ""
     1237     stop
    12291238  endif
    12301239endif
     
    12381247  !    WRITE(*,*) 'NF_NOERR', NF_NOERR
    12391248  !    CALL abort
    1240      stop ""
     1249     stop
    12411250  endif
    12421251endif
  • 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
  • trunk/LMDZ.MARS/util/solzenangle.F90

    r2434 r2567  
    1717character (len=30), dimension(16) :: notprocessed
    1818! notprocessed(): names of the (16) variables that won't be processed
    19 character (len=50), dimension(:), allocatable :: var
     19character (len=100), dimension(:), allocatable :: var
    2020! var(): name(s) of variable(s) that will be processed
    2121character (len=100) :: tmpvar,long_name,units
     
    141141if (len_trim(file).eq.0) then
    142142   write(*,*) "no file... game over"
    143    stop ""
     143   stop
    144144endif
    145145
     
    152152   write(*,*) 'ERROR: Pb opening file '//trim(file)
    153153   write(*,*) NF_STRERROR(ierr)
    154    stop ""
     154   stop
    155155endif
    156156
     
    160160   write(*,*) 'ERROR: Pb with NF_INQ_NVARS'
    161161   write(*,*) NF_STRERROR(ierr)
    162    stop ""
     162   stop
    163163endif
    164164
     
    218218write(*,*) "(an empty line , i.e: just <Enter>, implies end of list)"
    219219nbvar=0
    220 read(*,'(a50)') tmpvar
     220read(*,'(a100)') tmpvar
    221221do while ((tmpvar/=' ').AND.(trim(tmpvar)/='all'))
    222222   nbvar=nbvar+1
    223223   var(nbvar)=tmpvar
    224    read(*,'(a50)') tmpvar
     224   read(*,'(a100)') tmpvar
    225225enddo
    226226
     
    238238else if(nbvar==0) then
    239239   write(*,*) "no variable... game over"
    240    stop ""
     240   stop
    241241endif ! of if (tmpvar=="all")
    242242
     
    252252   write(*,*) 'ERROR: Pb opening file '//trim(file)
    253253   write(*,*) NF_STRERROR(ierr)
    254    stop ""
     254   stop
    255255endif
    256256
     
    262262   if (ierr.NE.NF_NOERR) then
    263263      write(*,*) 'ERROR: Dimension <latitude> is missing in file '//trim(file)
    264       stop ""
     264      stop
    265265   endif
    266266   ierr=NF_INQ_VARID(nid,"latitude",latvar)
    267267   if (ierr.NE.NF_NOERR) then
    268268      write(*,*) 'ERROR: Field <latitude> is missing in file '//trim(file)
    269       stop ""
     269      stop
    270270   endif
    271271   ierr=NF_INQ_DIMLEN(nid,latdim,latlen)
     
    275275   if (ierr.NE.NF_NOERR) then
    276276      write(*,*) 'ERROR: Dimension <longitude> is missing in file '//trim(file)
    277       stop ""
     277      stop
    278278   endif
    279279   ierr=NF_INQ_VARID(nid,"longitude",lonvar)
    280280   if (ierr.NE.NF_NOERR) then
    281281      write(*,*) 'ERROR: Field <longitude> is missing in file'//trim(file)
    282       stop ""
     282      stop
    283283   endif
    284284   ierr=NF_INQ_DIMLEN(nid,londim,lonlen)
     
    288288   if (ierr.NE.NF_NOERR) then
    289289      write(*,*) 'ERROR: Dimension <altitude> is missing in file '//trim(file)
    290       stop ""
     290      stop
    291291   endif
    292292   ierr=NF_INQ_VARID(nid,"altitude",altvar)
    293293   if (ierr.NE.NF_NOERR) then
    294294      write(*,*) 'ERROR: Field <altitude> is missing in file'//trim(file)
    295       stop ""
     295      stop
    296296   endif
    297297   ierr=NF_INQ_DIMLEN(nid,altdim,altlen)
     
    315315      write(*,*) ' Dimension <index> is missing in file '//trim(file)
    316316      ctllen=0
    317       !stop ""
     317      !stop
    318318   endif
    319319   ierr=NF_INQ_VARID(nid,"controle",ctlvar)
     
    321321      write(*,*) 'Field <controle> is missing in file '//trim(file)
    322322      ctllen=0
    323       !stop ""
     323      !stop
    324324   else
    325325      ierr=NF_INQ_DIMLEN(nid,ctldim,ctllen)
     
    401401   if (ierr.NE.NF_NOERR) then
    402402      write(*,*) 'ERROR: Dimension <Time> is missing in file'//trim(file)
    403       stop ""
     403      stop
    404404   endif
    405405   ierr=NF_INQ_VARID(nid,"Time",timevar)
    406406   if (ierr.NE.NF_NOERR) then
    407407      write(*,*) 'ERROR: Field <Time> is missing in file'//trim(file)
    408       stop ""
     408      stop
    409409   endif
    410410   ierr=NF_INQ_DIMLEN(nid,timedim,timelen)
     
    583583
    584584     do it=1,nsol
    585        ierr= NF_PUT_VARA_REAL(nout,timevarout,it,1,intsol(it)*24.)
     585       ierr= NF_PUT_VARA_REAL(nout,timevarout,(/it/),(/1/),intsol(it)*24.)
    586586     enddo
    587587   else
    588588     do it=1,nsol
    589        ierr= NF_PUT_VARA_REAL(nout,timevarout,it,1,intsol(it))
     589       ierr= NF_PUT_VARA_REAL(nout,timevarout,(/it/),(/1/),intsol(it))
    590590       if (ierr.NE.NF_NOERR) then
    591591         write(*,*) "Error , failed to write Time"
     
    609609      if (ierr.NE.NF_NOERR) then
    610610         write(*,*) 'ERROR: Field <',var(j),'> not found in file'//file
    611          stop ""
     611         stop
    612612      endif
    613613      ierr=nf_inq_varndims(nid,varid,ndim)
     
    768768       if (ierr.ne.NF_NOERR) then
    769769         write(*,*) 'PUT_VAR ERROR: ',NF_STRERROR(ierr)
    770          stop ""
     770         stop
    771771       endif
    772772
     
    814814   if (ierr.ne.NF_NOERR) then
    815815      write(*,*) 'PUT_VAR ERROR: ',NF_STRERROR(ierr)
    816       stop ""
     816      stop
    817817   endif
    818818
     
    929929   WRITE(*,*)'ERROR: Impossible to create the file ',trim(filename)
    930930   write(*,*) NF_STRERROR(ierr)
    931    stop ""
     931   stop
    932932endif
    933933
     
    940940   WRITE(*,*)'initiate: error failed to define dimension <latitude>'
    941941   write(*,*) NF_STRERROR(ierr)
    942    stop ""
     942   stop
    943943endif
    944944ierr = NF_DEF_DIM(nout, "longitude", lonlen, londimout)
     
    946946   WRITE(*,*)'initiate: error failed to define dimension <longitude>'
    947947   write(*,*) NF_STRERROR(ierr)
    948    stop ""
     948   stop
    949949endif
    950950ierr = NF_DEF_DIM(nout, "altitude", altlen, altdimout)
     
    952952   WRITE(*,*)'initiate: error failed to define dimension <altitude>'
    953953   write(*,*) NF_STRERROR(ierr)
    954    stop ""
     954   stop
    955955endif
    956956if (size(ctl).ne.0) then
     
    959959    WRITE(*,*)'initiate: error failed to define dimension <index>'
    960960    write(*,*) NF_STRERROR(ierr)
    961     stop ""
     961    stop
    962962  endif
    963963endif
     
    966966   WRITE(*,*)'initiate: error failed to define dimension <Time>'
    967967   write(*,*) NF_STRERROR(ierr)
    968    stop ""
     968   stop
    969969endif
    970970
     
    973973   WRITE(*,*)'initiate: error failed to define dimension <GCM_layers>'
    974974   write(*,*) NF_STRERROR(ierr)
    975    stop ""
     975   stop
    976976endif
    977977
     
    981981   WRITE(*,*)'initiate: error failed to switch out of define mode'
    982982   write(*,*) NF_STRERROR(ierr)
    983    stop ""
     983   stop
    984984endif
    985985!==============================================================================
     
    992992ierr = NF_REDEF (nout)
    993993ierr = NF_PUT_ATT_TEXT(nout,timevarout,'comment',135,&
    994 "The true unit of the variable Time is the integer value &
    995  of sol at lon=0deg. A false unit is put to enable reading from Grads or Ferret")
     994"The true unit of the variable Time is the integer value "//&
     995"of sol at lon=0deg. A false unit is put to enable reading from Grads or Ferret")
    996996! End netcdf define mode
    997997ierr = NF_ENDDEF(nout)
     
    10081008   WRITE(*,*)'initiate: error failed writing variable <latitude>'
    10091009   write(*,*) NF_STRERROR(ierr)
    1010    stop ""
     1010   stop
    10111011endif
    10121012
     
    10221022   WRITE(*,*)'initiate: error failed writing variable <longitude>'
    10231023   write(*,*) NF_STRERROR(ierr)
    1024    stop ""
     1024   stop
    10251025endif
    10261026
     
    10451045   WRITE(*,*)'initiate: error failed writing variable <altitude>'
    10461046   write(*,*) NF_STRERROR(ierr)
    1047    stop ""
     1047   stop
    10481048endif
    10491049
     
    10671067      WRITE(*,*)'initiate: error failed writing variable <controle>'
    10681068      write(*,*) NF_STRERROR(ierr)
    1069       stop ""
     1069      stop
    10701070   endif
    10711071endif
     
    11341134  hybrid=.true.
    11351135  if (ierr.ne.NF_NOERR) then
    1136     stop "init2 Error: Failed reading aps"
     1136    write(*,*) "init2 Error: Failed reading aps"
     1137    stop
    11371138  endif
    11381139
     
    11511152    ierr=NF_GET_VAR_REAL(infid,tmpvarid,bps)
    11521153    if (ierr.ne.NF_NOERR) then
    1153       stop "init2 Error: Failed reading bps"
     1154      write(*,*) "init2 Error: Failed reading bps"
     1155      stop
    11541156    endif
    11551157  endif
     
    11701172  ierr=NF_GET_VAR_REAL(infid,tmpvarid,phisinit)
    11711173  if (ierr.ne.NF_NOERR) then
    1172     stop "init2 Error: Failed reading phisinit"
     1174    write(*,*) "init2 Error: Failed reading phisinit"
     1175    stop
    11731176  endif
    11741177  phis = .true.
     
    11891192               (/layerdimout/),apsid,ierr)
    11901193  if (ierr.ne.NF_NOERR) then
    1191     stop "Error: Failed to def_var aps"
     1194    write(*,*) "Error: Failed to def_var aps"
     1195    stop
    11921196  endif
    11931197
     
    11951199  ierr=NF_PUT_VAR_REAL(outfid,apsid,aps)
    11961200  if (ierr.ne.NF_NOERR) then
    1197     stop "Error: Failed to write aps"
     1201    write(*,*) "Error: Failed to write aps"
     1202    stop
    11981203  endif
    11991204 
     
    12021207               (/layerdimout/),bpsid,ierr)
    12031208  if (ierr.ne.NF_NOERR) then
    1204     stop "Error: Failed to def_var bps"
     1209    write(*,*) "Error: Failed to def_var bps"
     1210    stop
    12051211  endif
    12061212
     
    12081214  ierr=NF_PUT_VAR_REAL(outfid,bpsid,bps)
    12091215  if (ierr.ne.NF_NOERR) then
    1210     stop "Error: Failed to write bps"
     1216    write(*,*) "Error: Failed to write bps"
     1217    stop
    12111218  endif
    12121219 
     
    12251232              (/londimout,latdimout/),phisinitid,ierr)
    12261233  if (ierr.ne.NF_NOERR) then
    1227      stop "Error: Failed to def_var phisinit"
     1234     write(*,*) "Error: Failed to def_var phisinit"
     1235     stop
    12281236  endif
    12291237
     
    12311239  ierr=NF_PUT_VAR_REAL(outfid,phisinitid,phisinit)
    12321240  if (ierr.ne.NF_NOERR) then
    1233     stop "Error: Failed to write phisinit"
     1241    write(*,*) "Error: Failed to write phisinit"
     1242    stop
    12341243  endif
    12351244
     
    13471356     !write(*,*) 'NF_NOERR', NF_NOERR
    13481357     !CALL abort
    1349      stop ""
     1358     stop
    13501359  endif
    13511360endif
     
    13601369  !    WRITE(*,*) 'NF_NOERR', NF_NOERR
    13611370  !    CALL abort
    1362      stop ""
     1371     stop
    13631372  endif
    13641373endif
  • trunk/LMDZ.MARS/util/streamfunction.F90

    r2513 r2567  
    129129if (ierr.ne.NF_NOERR) then
    130130   write(*,*) 'ERROR: Pb opening input file'
    131    stop ""
     131   stop
    132132endif
    133133
     
    143143ierr=NF_INQ_DIMID(infid,"latitude",tmpdimid)
    144144if (ierr.ne.NF_NOERR) then
    145   stop "Error: Failed to get latitude dimension ID"
     145  write(*,*) "Error: Failed to get latitude dimension ID"
     146  stop
    146147else
    147148  ierr=NF_INQ_VARID(infid,"latitude",tmpvarid)
    148149  if (ierr.ne.NF_NOERR) then
    149     stop "Error: Failed to get latitude ID"
     150    write(*,*) "Error: Failed to get latitude ID"
     151    stop
    150152  else
    151153    ierr=NF_INQ_DIMLEN(infid,tmpdimid,latlength)
    152154    if (ierr.ne.NF_NOERR) then
    153       stop "Error: Failed to get latitude length"
     155      write(*,*) "Error: Failed to get latitude length"
     156      stop
    154157    else
    155158      allocate(lat(latlength))
    156159      ierr=NF_GET_VAR_REAL(infid,tmpvarid,lat)
    157160      if (ierr.ne.NF_NOERR) then
    158         stop "Error: Failed reading latitude"
     161        write(*,*) "Error: Failed reading latitude"
     162        stop
    159163      endif
    160164    endif
     
    165169ierr=NF_INQ_DIMID(infid,"longitude",tmpdimid)
    166170if (ierr.ne.NF_NOERR) then
    167   stop "Error: Failed to get longitude dimension ID"
     171  write(*,*) "Error: Failed to get longitude dimension ID"
     172  stop
    168173else
    169174  ierr=NF_INQ_VARID(infid,"longitude",tmpvarid)
    170175  if (ierr.ne.NF_NOERR) then
    171     stop "Error: Failed to get longitude ID"
     176    write(*,*) "Error: Failed to get longitude ID"
     177    stop
    172178  else
    173179    ierr=NF_INQ_DIMLEN(infid,tmpdimid,lonlength)
    174180    if (ierr.ne.NF_NOERR) then
    175       stop "Error: Failed to get longitude length"
     181      write(*,*) "Error: Failed to get longitude length"
     182      stop
    176183    else
    177184      allocate(lon(lonlength))
    178185      ierr=NF_GET_VAR_REAL(infid,tmpvarid,lon)
    179186      if (ierr.ne.NF_NOERR) then
    180         stop "Error: Failed reading longitude"
     187        write(*,*) "Error: Failed reading longitude"
     188        stop
    181189      endif
    182190    endif
     
    187195ierr=NF_INQ_DIMID(infid,"Time",tmpdimid)
    188196if (ierr.ne.NF_NOERR) then
    189   stop "Error: Failed to get Time dimension ID"
     197  write(*,*) "Error: Failed to get Time dimension ID"
     198  stop
    190199else
    191200  ierr=NF_INQ_VARID(infid,"Time",tmpvarid)
    192201  if (ierr.ne.NF_NOERR) then
    193     stop "Error: Failed to get Time ID"
     202    write(*,*) "Error: Failed to get Time ID"
     203    stop
    194204  else
    195205    ierr=NF_INQ_DIMLEN(infid,tmpdimid,timelength)
    196206    if (ierr.ne.NF_NOERR) then
    197       stop "Error: Failed to get Time length"
     207      write(*,*) "Error: Failed to get Time length"
     208      stop
    198209    else
    199210      allocate(time(timelength))
    200211      ierr=NF_GET_VAR_REAL(infid,tmpvarid,time)
    201212      if (ierr.ne.NF_NOERR) then
    202         stop "Error: Failed reading Time"
     213        write(*,*) "Error: Failed reading Time"
     214        stop
    203215      endif
    204216    endif
     
    209221ierr=NF_INQ_DIMID(infid,"altitude",tmpdimid)
    210222if (ierr.ne.NF_NOERR) then
    211   stop "Error: Failed to get altitude dimension ID"
     223  write(*,*) "Error: Failed to get altitude dimension ID"
     224  stop
    212225else
    213226  ierr=NF_INQ_VARID(infid,"altitude",tmpvarid)
    214227  if (ierr.ne.NF_NOERR) then
    215      stop "Error: Failed to get altitude length"
     228     write(*,*) "Error: Failed to get altitude length"
     229     stop
    216230  else
    217231     ierr=NF_INQ_DIMLEN(infid,tmpdimid,altlength)
    218232     if (ierr.ne.NF_NOERR) then
    219         stop "Error: Failed to get altitude length"
     233        write(*,*) "Error: Failed to get altitude length"
     234        stop
    220235     else   
    221236        allocate(alt(altlength))
    222237        ierr=NF_GET_VAR_REAL(infid,tmpvarid,alt)
    223238        if (ierr.ne.NF_NOERR) then
    224            stop "Error: Failed reading Altitude"
     239           write(*,*) "Error: Failed reading Altitude"
     240           stop
    225241        endif
    226242     endif
     
    235251ierr=NF_INQ_VARID(infid,"aps",tmpvarid)
    236252if (ierr.ne.NF_NOERR) then
    237    stop "Error: Failed to get aps ID"
     253   write(*,*) "Error: Failed to get aps ID"
     254   stop
    238255else
    239256   allocate(aps(altlength))
    240257   ierr=NF_GET_VAR_REAL(infid,tmpvarid,aps)
    241258   if (ierr.ne.NF_NOERR) then
    242       stop "Error: Failed reading aps"
     259      write(*,*) "Error: Failed reading aps"
     260      stop
    243261   endif
    244262endif
     
    247265ierr=NF_INQ_VARID(infid,"bps",tmpvarid)
    248266if (ierr.ne.NF_NOERR) then
    249    stop "Error: Failed to get bps ID"
     267   write(*,*) "Error: Failed to get bps ID"
     268   stop
    250269else
    251270   allocate(bps(altlength))
    252271   ierr=NF_GET_VAR_REAL(infid,tmpvarid,bps)
    253272   if (ierr.ne.NF_NOERR) then
    254       stop "Error: Failed reading bps"
     273      write(*,*) "Error: Failed reading bps"
     274      stop
    255275   endif
    256276endif
     
    259279ierr=NF_INQ_VARID(infid,"ps",tmpvarid)
    260280if (ierr.ne.NF_NOERR) then
    261    stop "Error: Failed to get ps ID"
     281   write(*,*) "Error: Failed to get ps ID"
     282   stop
    262283else
    263284   allocate(ps(lonlength,latlength,timelength))
    264285   ierr=NF_GET_VAR_REAL(infid,tmpvarid,ps)
    265286   if (ierr.ne.NF_NOERR) then
    266       stop "Error: Failed reading ps"
     287      write(*,*) "Error: Failed reading ps"
     288      stop
    267289   endif
    268290endif
     
    284306ierr=NF_INQ_VARID(infid,"u",tmpvarid)
    285307if (ierr.ne.NF_NOERR) then
    286   stop "Error: Failed to get u ID"
     308  write(*,*) "Error: Failed to get u ID"
     309  stop
    287310else
    288311  allocate(u(lonlength,latlength,altlength,timelength))
    289312  ierr=NF_GET_VAR_REAL(infid,tmpvarid,u)
    290313  if (ierr.ne.NF_NOERR) then
    291     stop "Error: Failed reading zonal wind"
     314    write(*,*) "Error: Failed reading zonal wind"
     315    stop
    292316  endif
    293317endif
     
    296320ierr=NF_INQ_VARID(infid,"v",tmpvarid)
    297321if (ierr.ne.NF_NOERR) then
    298   stop "Error: Failed to get v ID"
     322  write(*,*) "Error: Failed to get v ID"
     323  stop
    299324else
    300325  allocate(v(lonlength,latlength,altlength,timelength))
    301326  ierr=NF_GET_VAR_REAL(infid,tmpvarid,v)
    302327  if (ierr.ne.NF_NOERR) then
    303     stop "Error: Failed reading zonal wind"
     328    write(*,*) "Error: Failed reading zonal wind"
     329    stop
    304330  endif
    305331endif
     
    322348     if (ierr.ne.NF_NOERR) then
    323349        write(*,*) "Problem: Could not find/open these files"
    324         stop "Might as well stop here"
     350        write(*,*) "Might as well stop here"
     351        stop
    325352     endif
    326353  endif
     
    329356   ierr=NF_INQ_VARID(infid2,"aire",tmpvarid)
    330357   if (ierr.ne.NF_NOERR) then
    331       stop "Error: Failed to get aire ID"
     358      write(*,*) "Error: Failed to get aire ID"
     359      stop
    332360   endif
    333361   ! Get aire
    334362   ierr=NF_GET_VAR_REAL(infid2,tmpvarid,aire)
    335363   if (ierr.ne.NF_NOERR) then
    336       stop "Error: Failed reading aire"
     364      write(*,*) "Error: Failed reading aire"
     365      stop
    337366   endif
    338367   ! Close file
     
    342371   ierr=NF_GET_VAR_REAL(infid,tmpvarid,aire)
    343372   if (ierr.ne.NF_NOERR) then
    344       stop "Error: Failed reading aire"
     373      write(*,*) "Error: Failed reading aire"
     374      stop
    345375   endif
    346376endif
     
    363393     if (ierr.ne.NF_NOERR) then
    364394        write(*,*) "Problem: Could not find/open these files"
    365         stop "Might as well stop here"
     395        write(*,*) "Might as well stop here"
     396        stop
    366397     endif
    367398  endif
     
    371402   ierr=NF_INQ_VARID(infid2,"phisinit",tmpvarid)
    372403   if (ierr.ne.NF_NOERR) then
    373       stop "Error: Failed to get phisinit ID"
     404      write(*,*) "Error: Failed to get phisinit ID"
     405      stop
    374406   endif
    375407   ! Get phisinit
    376408   ierr=NF_GET_VAR_REAL(infid2,tmpvarid,phisinit)
    377409   if (ierr.ne.NF_NOERR) then
    378       stop "Error: Failed reading phisinit"
     410      write(*,*) "Error: Failed reading phisinit"
     411      stop
    379412   endif
    380413   ! Close file
     
    384417   ierr=NF_GET_VAR_REAL(infid,tmpvarid,phisinit)
    385418   if (ierr.ne.NF_NOERR) then
    386       stop "Error: Failed reading phisinit"
     419      write(*,*) "Error: Failed reading phisinit"
     420      stop
    387421   endif
    388422endif
     
    407441     if (ierr.ne.NF_NOERR) then
    408442        write(*,*) "Problem: Could not find/open these files"
    409         stop "Might as well stop here"
     443        write(*,*) "Might as well stop here"
     444        stop
    410445     endif
    411446  endif
     
    415450   ierr=NF_INQ_VARID(infid2,"cv",tmpvarid)
    416451   if (ierr.ne.NF_NOERR) then
    417       stop "Error: Failed to get cv ID"
     452      write(*,*) "Error: Failed to get cv ID"
     453      stop
    418454   endif
    419455   ! Get cv
    420456   ierr=NF_GET_VAR_REAL(infid2,tmpvarid,cv)
    421457   if (ierr.ne.NF_NOERR) then
    422       stop "Error: Failed reading cv"
     458      write(*,*) "Error: Failed reading cv"
     459      stop
    423460   endif
    424461   ! Close file
     
    428465   ierr=NF_GET_VAR_REAL(infid,tmpvarid,cv)
    429466   if (ierr.ne.NF_NOERR) then
    430       stop "Error: Failed reading cv"
     467      write(*,*) "Error: Failed reading cv"
     468      stop
    431469   endif
    432470endif
     
    436474ierr=NF_INQ_VARID(infid,"temp",tmpvarid)
    437475if (ierr.ne.NF_NOERR) then
    438   stop "Error: Failed to get temp ID"
     476  write(*,*) "Error: Failed to get temp ID"
     477  stop
    439478else
    440479  allocate(temp(lonlength,latlength,altlength,timelength))
    441480  ierr=NF_GET_VAR_REAL(infid,tmpvarid,temp)
    442481  if (ierr.ne.NF_NOERR) then
    443     stop "Error: Failed reading temperature"
     482    write(*,*) "Error: Failed reading temperature"
     483    stop
    444484  endif
    445485endif
     
    464504  ierr=NF_GET_VAR_REAL(infid,tmpvarid,rho)
    465505  if (ierr.ne.NF_NOERR) then
    466     stop "Error: Failed reading mass density"
     506    write(*,*) "Error: Failed reading mass density"
     507    stop
    467508  endif
    468509endif
     
    666707lon_fake(1)=0.
    667708#ifdef NC_DOUBLE
    668         ierr= NF_PUT_VARA_DOUBLE(nout,lonvarout,1,1,lon_fake)
     709        ierr= NF_PUT_VARA_DOUBLE(nout,lonvarout,(/1/),(/1/),lon_fake)
    669710#else
    670         ierr= NF_PUT_VARA_REAL(nout,lonvarout,1,1,lon_fake)
     711        ierr= NF_PUT_VARA_REAL(nout,lonvarout,(/1/),(/1/),lon_fake)
    671712#endif
    672713
    673714! 3.1.3 New time dimension/value in output file
    674715#ifdef NC_DOUBLE
    675         ierr= NF_PUT_VARA_DOUBLE(nout,timevarout,1,1,lon_fake)
     716        ierr= NF_PUT_VARA_DOUBLE(nout,timevarout,(/1/),(/1/),lon_fake)
    676717#else
    677         ierr= NF_PUT_VARA_REAL(nout,timevarout,1,1,lon_fake)
     718        ierr= NF_PUT_VARA_REAL(nout,timevarout,(/1/),(/1/),lon_fake)
    678719#endif
    679720
     
    690731if (ierr.ne.NF_NOERR) then
    691732   write(*,*) 'Error, could not define variable psi'
    692    stop ""
     733   stop
    693734endif
    694735
     
    705746if (ierr.ne.NF_NOERR) then
    706747   write(*,*) 'Error, could not define variable momave'
    707    stop ""
     748   stop
    708749endif
    709750
     
    721762if (ierr.ne.NF_NOERR) then
    722763   write(*,*) 'Error, could not define variable u'
    723    stop ""
     764   stop
    724765endif
    725766
     
    737778if (ierr.ne.NF_NOERR) then
    738779   write(*,*) 'Error, could not define variable v'
    739    stop ""
     780   stop
    740781endif
    741782
     
    752793if (ierr.ne.NF_NOERR) then
    753794   write(*,*) 'Error, could not define variable rho'
    754    stop ""
     795   stop
    755796endif
    756797
     
    767808if (ierr.ne.NF_NOERR) then
    768809   write(*,*) 'Error, could not define variable temp'
    769    stop ""
     810   stop
    770811endif
    771812
     
    782823if (ierr.ne.NF_NOERR) then
    783824   write(*,*) 'Error, could not define variable ps'
    784    stop ""
     825   stop
    785826endif
    786827
     
    798839if (ierr.ne.NF_NOERR) then
    799840   write(*,*) 'Error, could not define variable phisinit'
    800    stop ""
     841   stop
    801842endif
    802843
     
    874915if (ierr.NE.NF_NOERR) then
    875916   WRITE(*,*)'ERROR: Impossible to create the file.'
    876    stop ""
     917   stop
    877918endif
    878919
     
    9831024  ierr=NF_GET_VAR_REAL(infid,tmpvarid,aps)
    9841025  if (ierr.ne.NF_NOERR) then
    985    stop "error: Failed reading aps"
     1026   write(*,*) "error: Failed reading aps"
     1027   stop
    9861028  endif
    9871029  aps_ok=.true.
     
    9971039  ierr=NF_GET_VAR_REAL(infid,tmpvarid,bps)
    9981040  if (ierr.ne.NF_NOERR) then
    999     stop "Error: Failed reading bps"
     1041    write(*,*) "Error: Failed reading bps"
     1042    stop
    10001043  endif
    10011044  bps_ok=.true.
     
    10151058        (/altdimout/),apsid,ierr)
    10161059   if (ierr.ne.NF_NOERR) then
    1017       stop "Error: Failed to def_var aps"
     1060      write(*,*) "Error: Failed to def_var aps"
     1061      stop
    10181062   endif
    10191063
     
    10251069#endif
    10261070   if (ierr.ne.NF_NOERR) then
    1027       stop "Error: Failed to write aps"
     1071      write(*,*) "Error: Failed to write aps"
     1072      stop
    10281073   endif
    10291074ENDIF
     
    10341079        (/altdimout/),bpsid,ierr)
    10351080   if (ierr.ne.NF_NOERR) then
    1036       stop "Error: Failed to def_var bps"
     1081      write(*,*) "Error: Failed to def_var bps"
     1082      stop
    10371083   endif
    10381084
     
    10441090#endif
    10451091   if (ierr.ne.NF_NOERR) then
    1046       stop "Error: Failed to write bps"
     1092      write(*,*) "Error: Failed to write bps"
     1093      stop
    10471094   endif
    10481095ENDIF
  • trunk/LMDZ.MARS/util/xvik/fit_Iceinertia_MONSicedepth.F

    r2338 r2567  
    132132   
    133133       maxiceidiff = 3000  ! maximum allowed difference between N and S best fit ice thermal inertia
    134        deltaicei= 20    ! step in ice thermal inertia
     134       deltaicei= 20        ! step in ice thermal inertia
    135135       maxiceddiff = 30.e-4  ! maximum allowed difference between N and S best fit ice depth
    136136       deltaiced= 0.5e-4 ! step in ice depth coefficient
     
    332332        read(13,*) solgcm(n), patm(n,3), pcapn(n,3),pcaps(n,3)
    333333        read(14,*) solgcm(n), patm(n,4), pcapn(n,4),pcaps(n,4)
    334        
     334       
    335335        elseif (time_unit == 2) then
    336336        read(21,*) lsgcm(n),  pvl_gcm(n,1)
     
    358358        read(13,*) solgcm(n), lsgcm(n), patm(n,3), pcapn(n,3),pcaps(n,3)
    359359        read(14,*) solgcm(n), lsgcm(n), patm(n,4), pcapn(n,4),pcaps(n,4)
    360        
    361         else
    362         write(*,*) 'Wrong integer for xvik files format :',
     360       
     361        else
     362        write(*,*) 'Wrong integer for xvik files format :',
    363363     &' must be 1, 2 or 3'
    364364        stop
    365365
    366366        endif
    367        
     367       
    368368c       Checking total CO2 inventory for all runs :
    369369        do i=1,4
     
    381381      end do
    382382
    383         close(11)
    384         close(12)
    385         close(13)
    386         close(14)
    387         close(21)
    388         close(22)
    389         close(23)
    390         close(24)
    391        
    392        
     383        close(11)
     384        close(12)
     385        close(13)
     386        close(14)
     387        close(21)
     388        close(22)
     389        close(23)
     390        close(24)
     391       
     392       
    393393c      Smoothing simulated GCM Viking 1 pressure curves
    394394c      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     
    493493c     to plot COST(DN,DS) (plot_test=1), loops must be in this order : DN->DS->IN->IS           
    494494        write(*,*)'   DN        DS      cost       IN       IS       Ps'
    495         icedn=icedmin ! initialization         
     495        icedn=icedmin ! initialization               
    496496        do while (icedn.le.icedmax) ! loop on northern ice depth coefficient
    497497!         albn=albmin ! initialization
     
    510510              cost =0. !initialization
    511511              do n=1,nsol 
    512                 !write(*,*) n
     512                !write(*,*) n
    513513               ! Pressure corresponding to Northern cap
    514514               pcapn_new=pcapn_sm(n,refrun)+
     
    527527               ! and observed pressures at VL1 site
    528528               cost= cost+ ( pvl_obs(n) - pvl1)**2
    529                
     529               
    530530              end do ! of do n=1,nsol
    531531              ! store parameters which lead to minimum cost
     
    539539                 icedsfit=iceds
    540540              end if
    541            
     541           
    542542              if(cost.lt.cost4plot) then
    543543c                RMS, best pressure and best albedos for these icedsivities value
     
    575575c     to plot COST(IN,IS) (plot_test=2), loops must be in this order : IN->IS->DN->DS           
    576576        write(*,*)'   DN        DS      cost       IN       IS       Ps'
    577         write(33,*)'   DN        DS      cost       IN       IS     
    578      &Ps'       
    579         icein=iceimin ! initialization         
     577        write(33,*)'   DN        DS      cost       IN       IS     Ps'
     578        icein=iceimin ! initialization               
    580579        do while (icein.le.iceimax) ! loop on northern ice depth coefficient
    581580!         albn=albmin ! initialization
     
    594593              cost =0. !initialization
    595594              do n=1,nsol 
    596                 !write(*,*) n
     595                !write(*,*) n
    597596               ! Pressure corresponding to Northern cap
    598597               pcapn_new=pcapn_sm(n,refrun)+
     
    611610               ! and observed pressures at VL1 site
    612611               cost= cost+ ( pvl_obs(n) - pvl1)**2
    613                
     612               
    614613              end do ! of do n=1,nsol
    615614              ! store parameters which lead to minimum cost
     
    623622                 icedsfit=iceds
    624623              end if
    625            
     624           
    626625              if(cost.lt.cost4plot) then
    627626c                RMS, best pressure and best albedos for these icedsivities value
     
    683682     &      + (fonc2s(icedsfit) -fonc2s(icedgcm_ref)) * dpdes(n)
    684683           pcaps_new= max(pcaps_new,0.)
    685        
     684       
    686685      call sol2ls(sol(n),solconv)   
    687686     
     
    722721
    723722
    724       if (nbig.lt.3*nmax) stop 'Must increase nbig in runave'
     723      if (nbig.lt.3*nmax) then
     724        write(*,*) 'Must increase nbig in runave'
     725        stop
     726      endif
    725727
    726728c     Reindexation des donnees
  • trunk/LMDZ.MARS/util/zrecast.F90

    r2546 r2567  
    176176   write(*,*) 'ERROR: Pb opening file ',trim(infile)
    177177   write(*,*) NF_STRERROR(ierr)
    178    stop ""
     178   stop
    179179endif
    180180
     
    270270  write(*,*) 'No variables to process !?'
    271271  write(*,*) 'Might as well stop here'
    272   stop ""
     272  stop
    273273else
    274274  write(*,*) ""
     
    294294  ierr=NF_INQ_DIMID(infid,"lat",tmpdimid)
    295295  if (ierr.ne.NF_NOERR) then
    296     stop "Error: Failed to get lat dimension ID"
     296    write(*,*) "Error: Failed to get lat dimension ID"
     297    stop
    297298  else
    298299    ierr=NF_INQ_VARID(infid,"lat",tmpvarid)
    299300    if (ierr.ne.NF_NOERR) then
    300       stop "Error: Failed to get lat ID"
     301      write(*,*) "Error: Failed to get lat ID"
     302      stop
    301303    else
    302304      ierr=NF_INQ_DIMLEN(infid,tmpdimid,latlength)
    303305      if (ierr.ne.NF_NOERR) then
    304         stop "Error: Failed to get lat length"
     306        write(*,*) "Error: Failed to get lat length"
     307        stop
    305308      else
    306309        allocate(lat(latlength),stat=ierr)
     
    312315        ierr=NF_GET_VAR_REAL(infid,tmpvarid,lat)
    313316        if (ierr.ne.NF_NOERR) then
    314           stop "Error: Failed reading lat"
     317          write(*,*) "Error: Failed reading lat"
     318          stop
    315319        endif
    316320      endif
     
    320324  ierr=NF_INQ_VARID(infid,"latitude",tmpvarid)
    321325  if (ierr.ne.NF_NOERR) then
    322     stop "Error: Failed to get latitude ID"
     326    write(*,*) "Error: Failed to get latitude ID"
     327    stop
    323328  else
    324329    ierr=NF_INQ_DIMLEN(infid,tmpdimid,latlength)
    325330    if (ierr.ne.NF_NOERR) then
    326       stop "Error: Failed to get latitude length"
     331      write(*,*) "Error: Failed to get latitude length"
     332      stop
    327333    else
    328334      allocate(lat(latlength),stat=ierr)
     
    334340      ierr=NF_GET_VAR_REAL(infid,tmpvarid,lat)
    335341      if (ierr.ne.NF_NOERR) then
    336         stop "Error: Failed reading latitude"
     342        write(*,*) "Error: Failed reading latitude"
     343        stop
    337344      endif
    338345    endif
     
    347354  ierr=NF_INQ_DIMID(infid,"lon",tmpdimid)
    348355  if (ierr.ne.NF_NOERR) then
    349     stop "Error: Failed to get lon dimension ID"
     356    write(*,*) "Error: Failed to get lon dimension ID"
     357    stop
    350358  else
    351359    ierr=NF_INQ_VARID(infid,"lon",tmpvarid)
    352360    if (ierr.ne.NF_NOERR) then
    353       stop "Error: Failed to get lon ID"
     361      write(*,*) "Error: Failed to get lon ID"
     362      stop
    354363    else
    355364      ierr=NF_INQ_DIMLEN(infid,tmpdimid,lonlength)
    356365      if (ierr.ne.NF_NOERR) then
    357         stop "Error: Failed to get lon length"
     366        write(*,*) "Error: Failed to get lon length"
     367        stop
    358368      else
    359369        allocate(lon(lonlength),stat=ierr)
     
    365375        ierr=NF_GET_VAR_REAL(infid,tmpvarid,lon)
    366376        if (ierr.ne.NF_NOERR) then
    367           stop "Error: Failed reading longitude"
     377          write(*,*) "Error: Failed reading longitude"
     378          stop
    368379        endif
    369380      endif
     
    373384  ierr=NF_INQ_VARID(infid,"longitude",tmpvarid)
    374385  if (ierr.ne.NF_NOERR) then
    375     stop "Error: Failed to get longitude ID"
     386    write(*,*) "Error: Failed to get longitude ID"
     387    stop
    376388  else
    377389    ierr=NF_INQ_DIMLEN(infid,tmpdimid,lonlength)
    378390    if (ierr.ne.NF_NOERR) then
    379       stop "Error: Failed to get longitude length"
     391      write(*,*) "Error: Failed to get longitude length"
     392      stop
    380393    else
    381394      allocate(lon(lonlength),stat=ierr)
     
    387400      ierr=NF_GET_VAR_REAL(infid,tmpvarid,lon)
    388401      if (ierr.ne.NF_NOERR) then
    389         stop "Error: Failed reading longitude"
     402        write(*,*) "Error: Failed reading longitude"
     403        stop
    390404      endif
    391405    endif
     
    404418    ierr=NF_INQ_DIMID(infid,"time_counter",tmpdimid)
    405419    if (ierr.ne.NF_NOERR) then
    406       stop "Error: Failed to get time_counter dimension ID"
     420      write(*,*) "Error: Failed to get time_counter dimension ID"
     421      stop
    407422    else
    408423      ierr=NF_INQ_VARID(infid,"time_counter",tmpvarid)
    409424      if (ierr.ne.NF_NOERR) then
    410         stop "Error: Failed to get time_counter ID"
     425        write(*,*) "Error: Failed to get time_counter ID"
     426        stop
    411427      else
    412428        ierr=NF_INQ_DIMLEN(infid,tmpdimid,timelength)
    413429        if (ierr.ne.NF_NOERR) then
    414           stop "Error: Failed to get time_counter length"
     430          write(*,*) "Error: Failed to get time_counter length"
     431          stop
    415432        else
    416433          allocate(time(timelength),stat=ierr)
     
    422439          ierr=NF_GET_VAR_REAL(infid,tmpvarid,time)
    423440          if (ierr.ne.NF_NOERR) then
    424             stop "Error: Failed reading time"
     441            write(*,*) "Error: Failed reading time"
     442            stop
    425443          endif
    426444        endif
     
    430448    ierr=NF_INQ_VARID(infid,"time",tmpvarid)
    431449    if (ierr.ne.NF_NOERR) then
    432       stop "Error: Failed to get time ID"
     450      write(*,*) "Error: Failed to get time ID"
     451      stop
    433452    else
    434453      ierr=NF_INQ_DIMLEN(infid,tmpdimid,timelength)
    435454      if (ierr.ne.NF_NOERR) then
    436         stop "Error: Failed to get time length"
     455        write(*,*) "Error: Failed to get time length"
     456        stop
    437457      else
    438458        allocate(time(timelength),stat=ierr)
     
    444464        ierr=NF_GET_VAR_REAL(infid,tmpvarid,time)
    445465        if (ierr.ne.NF_NOERR) then
    446           stop "Error: Failed reading time"
     466          write(*,*) "Error: Failed reading time"
     467          stop
    447468        endif
    448469      endif
     
    452473  ierr=NF_INQ_VARID(infid,"Time",tmpvarid)
    453474  if (ierr.ne.NF_NOERR) then
    454     stop "Error: Failed to get Time ID"
     475    write(*,*) "Error: Failed to get Time ID"
     476    stop
    455477  else
    456478    ierr=NF_INQ_DIMLEN(infid,tmpdimid,timelength)
    457479    if (ierr.ne.NF_NOERR) then
    458       stop "Error: Failed to get Time length"
     480      write(*,*) "Error: Failed to get Time length"
     481      stop
    459482    else
    460483      allocate(time(timelength),stat=ierr)
     
    466489      ierr=NF_GET_VAR_REAL(infid,tmpvarid,time)
    467490      if (ierr.ne.NF_NOERR) then
    468         stop "Error: Failed reading Time"
     491        write(*,*) "Error: Failed reading Time"
     492        stop
    469493      endif
    470494    endif
     
    479503  ierr=NF_INQ_DIMID(infid,"sigma",tmpdimid)
    480504  if (ierr.ne.NF_NOERR) then
    481     stop "Error: Failed to get sigma dimension ID"
     505    write(*,*) "Error: Failed to get sigma dimension ID"
     506    stop
    482507  else
    483508    ierr=NF_INQ_DIMLEN(infid,tmpdimid,altlength)
    484509    if (ierr.ne.NF_NOERR) then
    485       stop "Error: Failed to get altitude length"
     510      write(*,*) "Error: Failed to get altitude length"
     511      stop
    486512    endif
    487513  endif
     
    489515  ierr=NF_INQ_DIMLEN(infid,tmpdimid,altlength)
    490516  if (ierr.ne.NF_NOERR) then
    491       stop "Error: Failed to get altitude length"
     517      write(*,*) "Error: Failed to get altitude length"
     518      stop
    492519  endif
    493520endif
     
    504531    ierr=NF_INQ_VARID(infid,"controle",tmpvarid)
    505532    if (ierr.ne.NF_NOERR) then
    506       stop "Error: Failed to get controle ID"
     533      write(*,*) "Error: Failed to get controle ID"
     534      stop
    507535    else
    508536      ierr=NF_INQ_DIMLEN(infid,tmpdimid,ctllength)
    509537      if (ierr.ne.NF_NOERR) then
    510         stop "Error: Failed to get controle length"
     538        write(*,*) "Error: Failed to get controle length"
     539        stop
    511540      else
    512541        allocate(ctl(ctllength),stat=ierr)
     
    518547        ierr=NF_GET_VAR_REAL(infid,tmpvarid,ctl)
    519548        if (ierr.ne.NF_NOERR) then
    520           stop "Error: Failed reading controle"
     549          write(*,*) "Error: Failed reading controle"
     550          stop
    521551        endif
    522552      endif
     
    526556  ierr=NF_INQ_VARID(infid,"controle",tmpvarid)
    527557  if (ierr.ne.NF_NOERR) then
    528     stop "Error: Failed to get controle ID"
     558    write(*,*) "Error: Failed to get controle ID"
     559    stop
    529560  else
    530561    ierr=NF_INQ_DIMLEN(infid,tmpdimid,ctllength)
    531562    if (ierr.ne.NF_NOERR) then
    532       stop "Error: Failed to get controle length"
     563      write(*,*) "Error: Failed to get controle length"
     564      stop
    533565    else
    534566      allocate(ctl(ctllength),stat=ierr)
     
    540572      ierr=NF_GET_VAR_REAL(infid,tmpvarid,ctl)
    541573      if (ierr.ne.NF_NOERR) then
    542         stop "Error: Failed reading controle"
     574        write(*,*) "Error: Failed reading controle"
     575        stop
    543576      endif
    544577    endif
     
    563596  ierr=NF_GET_VAR_REAL(infid,tmpvarid,sigma)
    564597  if (ierr.ne.NF_NOERR) then
    565     stop "Error: Failed reading sigma"
     598    write(*,*) "Error: Failed reading sigma"
     599    stop
    566600  endif
    567601endif
     
    572606  ierr=NF_INQ_VARID(infid,"aps",tmpvarid)
    573607  if (ierr.ne.NF_NOERR) then
    574     stop "Error: Failed to get aps ID"
     608    write(*,*) "Error: Failed to get aps ID"
     609    stop
    575610  else
    576611    allocate(aps(altlength),stat=ierr)
     
    582617    ierr=NF_GET_VAR_REAL(infid,tmpvarid,aps)
    583618    if (ierr.ne.NF_NOERR) then
    584       stop "Error: Failed reading aps"
     619      write(*,*) "Error: Failed reading aps"
     620      stop
    585621    endif
    586622  endif
     
    589625  ierr=NF_INQ_VARID(infid,"bps",tmpvarid)
    590626  if (ierr.ne.NF_NOERR) then
    591     stop "Error: Failed to get bps ID"
     627    write(*,*) "Error: Failed to get bps ID"
     628    stop
    592629  else
    593630    allocate(bps(altlength),stat=ierr)
     
    599636    ierr=NF_GET_VAR_REAL(infid,tmpvarid,bps)
    600637    if (ierr.ne.NF_NOERR) then
    601       stop "Error: Failed reading bps"
     638      write(*,*) "Error: Failed reading bps"
     639      stop
    602640    endif
    603641  endif
     
    631669      if (ierr.ne.NF_NOERR) then
    632670        write(*,*) "Error: Could not open that file either"
    633         stop "Might as well stop here"
     671        write(*,*) "Might as well stop here"
     672        stop
    634673      endif
    635674    endif
     
    639678  ierr=NF_INQ_VARID(infid2,"phisinit",tmpvarid)
    640679  if (ierr.ne.NF_NOERR) then
    641     stop "Error: Failed to get phisinit ID"
     680    write(*,*) "Error: Failed to get phisinit ID"
     681    stop
    642682  endif
    643683  ! Get physinit
    644684  ierr=NF_GET_VAR_REAL(infid2,tmpvarid,phisinit)
    645685  if (ierr.ne.NF_NOERR) then
    646     stop "Error: Failed reading phisinit"
     686    write(*,*) "Error: Failed reading phisinit"
     687    stop
    647688  endif
    648689  ! Close file
     
    652693  ierr=NF_GET_VAR_REAL(infid,tmpvarid,phisinit)
    653694  if (ierr.ne.NF_NOERR) then
    654     stop "Error: Failed reading phisinit"
     695    write(*,*) "Error: Failed reading phisinit"
     696    stop
    655697  endif
    656698endif
     
    918960ierr=NF_INQ_VARID(infid,"ps",tmpvarid)
    919961if (ierr.ne.NF_NOERR) then
    920   stop "Error: Failed to get ps ID"
     962  write(*,*) "Error: Failed to get ps ID"
     963  stop
    921964else
    922965  allocate(ps(lonlength,latlength,timelength),stat=ierr)
     
    929972  ierr=NF_GET_VAR_REAL(infid,tmpvarid,ps)
    930973  if (ierr.ne.NF_NOERR) then
    931     stop "Error: Failed reading surface pressure"
     974    write(*,*) "Error: Failed reading surface pressure"
     975    stop
    932976  endif
    933977endif
     
    10221066  ierr=NF_GET_VAR_REAL(infid,tmpvarid,temp)
    10231067  if (ierr.ne.NF_NOERR) then
    1024     stop "Error: Failed reading atmospheric temperature"
     1068    write(*,*) "Error: Failed reading atmospheric temperature"
     1069    stop
    10251070  endif
    10261071  have_temp=.true.
     
    10461091  ierr=NF_GET_VAR_REAL(infid,tmpvarid,rho)
    10471092  if (ierr.ne.NF_NOERR) then
    1048     stop "Error: Failed reading atmospheric density"
     1093    write(*,*) "Error: Failed reading atmospheric density"
     1094    stop
    10491095  endif
    10501096endif
     
    12341280ierr=NF_PUT_ATT_TEXT(outfid,lon_varid,'long_name',len_trim(text),text)
    12351281if (ierr.ne.NF_NOERR) then
    1236   stop "Error: Problem writing long_name for longitude"
     1282  write(*,*) "Error: Problem writing long_name for longitude"
     1283  stop
    12371284endif
    12381285text='degrees_east'
    12391286ierr=NF_PUT_ATT_TEXT(outfid,lon_varid,'units',len_trim(text),text)
    12401287if (ierr.ne.NF_NOERR) then
    1241   stop "Error: Problem writing units for longitude"
     1288  write(*,*) "Error: Problem writing units for longitude"
     1289  stop
    12421290endif
    12431291
     
    12551303ierr=NF_PUT_ATT_TEXT(outfid,lat_varid,'long_name',len_trim(text),text)
    12561304if (ierr.ne.NF_NOERR) then
    1257   stop "Error: Problem writing long_name for latitude"
     1305  write(*,*) "Error: Problem writing long_name for latitude"
     1306  stop
    12581307endif
    12591308text='degrees_north'
    12601309ierr=NF_PUT_ATT_TEXT(outfid,lat_varid,'units',len_trim(text),text)
    12611310if (ierr.ne.NF_NOERR) then
    1262   stop "Error: Problem writing units for latitude"
     1311  write(*,*) "Error: Problem writing units for latitude"
     1312  stop
    12631313endif
    12641314
     
    12771327  ierr=NF_PUT_ATT_TEXT(outfid,alt_varid,'long_name',len_trim(text),text)
    12781328  if (ierr.ne.NF_NOERR) then
    1279     stop "Error: Problem writing long_name for altitude"
     1329    write(*,*) "Error: Problem writing long_name for altitude"
     1330    stop
    12801331  endif
    12811332  text='Pa'
    12821333  ierr=NF_PUT_ATT_TEXT(outfid,alt_varid,'units',len_trim(text),text)
    12831334  if (ierr.ne.NF_NOERR) then
    1284     stop "Error: Problem writing units for altitude"
     1335    write(*,*) "Error: Problem writing units for altitude"
     1336    stop
    12851337  endif
    12861338  text='down'
    12871339  ierr=NF_PUT_ATT_TEXT(outfid,alt_varid,'positive',len_trim(text),text)
    12881340  if (ierr.ne.NF_NOERR) then
    1289     stop "Error: Problem writing positive for altitude"
     1341    write(*,*) "Error: Problem writing positive for altitude"
     1342    stop
    12901343  endif
    12911344else if (ztype.eq.2) then ! above areoid vertical coordinate
     
    12931346  ierr=NF_PUT_ATT_TEXT(outfid,alt_varid,'long_name',len_trim(text),text)
    12941347  if (ierr.ne.NF_NOERR) then
    1295     stop "Error: Problem writing long_name for altitude"
     1348    write(*,*) "Error: Problem writing long_name for altitude"
     1349    stop
    12961350  endif
    12971351  text='m'
    12981352  ierr=NF_PUT_ATT_TEXT(outfid,alt_varid,'units',len_trim(text),text)
    12991353  if (ierr.ne.NF_NOERR) then
    1300     stop "Error: Problem writing units for altitude"
     1354    write(*,*) "Error: Problem writing units for altitude"
     1355    stop
    13011356  endif
    13021357  text='up'
    13031358  ierr=NF_PUT_ATT_TEXT(outfid,alt_varid,'positive',len_trim(text),text)
    13041359  if (ierr.ne.NF_NOERR) then
    1305     stop "Error: Problem writing positive for altitude"
     1360    write(*,*) "Error: Problem writing positive for altitude"
     1361    stop
    13061362  endif
    13071363else if (ztype.eq.3) then ! above surface vertical coordinate
     
    13091365  ierr=NF_PUT_ATT_TEXT(outfid,alt_varid,'long_name',len_trim(text),text)
    13101366  if (ierr.ne.NF_NOERR) then
    1311     stop "Error: Problem writing long_name for altitude"
     1367    write(*,*) "Error: Problem writing long_name for altitude"
     1368    stop
    13121369  endif
    13131370  text='m'
    13141371  ierr=NF_PUT_ATT_TEXT(outfid,alt_varid,'units',len_trim(text),text)
    13151372  if (ierr.ne.NF_NOERR) then
    1316     stop "Error: Problem writing units for altitude"
     1373    write(*,*) "Error: Problem writing units for altitude"
     1374    stop
    13171375  endif
    13181376  text='up'
    13191377  ierr=NF_PUT_ATT_TEXT(outfid,alt_varid,'positive',len_trim(text),text)
    13201378  if (ierr.ne.NF_NOERR) then
    1321     stop "Error: Problem writing positive for altitude"
     1379    write(*,*) "Error: Problem writing positive for altitude"
     1380    stop
    13221381  endif
    13231382else ! radial distance to center of planet
     
    13251384  ierr=NF_PUT_ATT_TEXT(outfid,alt_varid,'long_name',len_trim(text),text)
    13261385  if (ierr.ne.NF_NOERR) then
    1327     stop "Error: Problem writing long_name for altitude"
     1386    write(*,*) "Error: Problem writing long_name for altitude"
     1387    stop
    13281388  endif
    13291389  text='m'
    13301390  ierr=NF_PUT_ATT_TEXT(outfid,alt_varid,'units',len_trim(text),text)
    13311391  if (ierr.ne.NF_NOERR) then
    1332     stop "Error: Problem writing units for altitude"
     1392    write(*,*) "Error: Problem writing units for altitude"
     1393    stop
    13331394  endif
    13341395  text='up'
    13351396  ierr=NF_PUT_ATT_TEXT(outfid,alt_varid,'positive',len_trim(text),text)
    13361397  if (ierr.ne.NF_NOERR) then
    1337     stop "Error: Problem writing positive for altitude"
     1398    write(*,*) "Error: Problem writing positive for altitude"
     1399    stop
    13381400  endif
    13391401endif ! of if (have_sigma)
     
    13521414  ierr=NF_PUT_ATT_TEXT(outfid,ctl_varid,'title',len_trim(text),text)
    13531415  if (ierr.ne.NF_NOERR) then
    1354     stop "Error: Problem writing title for controle"
     1416    write(*,*) "Error: Problem writing title for controle"
     1417    stop
    13551418  endif
    13561419endif
     
    13871450  ierr=NF_PUT_ATT_TEXT(outfid,sigma_varid,'long_name',len_trim(text),text)
    13881451  if (ierr.ne.NF_NOERR) then
    1389     stop "Error: Problem writing long_name for sigma"
     1452    write(*,*) "Error: Problem writing long_name for sigma"
     1453    stop
    13901454  endif
    13911455else ! hybrid coordinates
     
    13931457  ierr=NF_PUT_ATT_TEXT(outfid,aps_varid,'long_name',len_trim(text),text)
    13941458  if (ierr.ne.NF_NOERR) then
    1395     stop "Error: Problem writing long_name for aps"
     1459    write(*,*) "Error: Problem writing long_name for aps"
     1460    stop
    13961461  endif
    13971462  text="hybrid sigma at midlayers"
    13981463  ierr=NF_PUT_ATT_TEXT(outfid,bps_varid,'long_name',len_trim(text),text)
    13991464  if (ierr.ne.NF_NOERR) then
    1400     stop "Error: Problem writing long_name for bps"
     1465    write(*,*) "Error: Problem writing long_name for bps"
     1466    stop
    14011467  endif
    14021468endif ! of if (have_sigma)
     
    14151481ierr=NF_PUT_ATT_TEXT(outfid,time_varid,'long_name',len_trim(text),text)
    14161482if (ierr.ne.NF_NOERR) then
    1417   stop "Error: Problem writing long_name for Time"
     1483  write(*,*) "Error: Problem writing long_name for Time"
     1484  stop
    14181485endif
    14191486text='days since 0000-01-1 00:00:00'
    14201487ierr=NF_PUT_ATT_TEXT(outfid,time_varid,'units',len_trim(text),text)
    14211488if (ierr.ne.NF_NOERR) then
    1422   stop "Error: Problem writing units for Time"
     1489  write(*,*) "Error: Problem writing units for Time"
     1490  stop
    14231491endif
    14241492
     
    14301498ierr=NF_PUT_ATT_TEXT(outfid,phis_varid,'long_name',len_trim(text),text)
    14311499if (ierr.ne.NF_NOERR) then
    1432   stop "Error: Problem writing long_name for phisinit"
     1500  write(*,*) "Error: Problem writing long_name for phisinit"
     1501  stop
    14331502endif
    14341503text='m2.s2'
    14351504ierr=NF_PUT_ATT_TEXT(outfid,phis_varid,'units',len_trim(text),text)
    14361505if (ierr.ne.NF_NOERR) then
    1437   stop "Error: Problem writing units for geopotential phisinit"
     1506  write(*,*) "Error: Problem writing units for geopotential phisinit"
     1507  stop
    14381508endif
    14391509
     
    14571527ierr=NF_PUT_ATT_TEXT(outfid,ps_varid,'long_name',len_trim(text),text)
    14581528if (ierr.ne.NF_NOERR) then
    1459   stop "Error: Problem writing long_name for surface pressure"
     1529  write(*,*) "Error: Problem writing long_name for surface pressure"
     1530  stop
    14601531endif
    14611532text='Pa'
    14621533ierr=NF_PUT_ATT_TEXT(outfid,ps_varid,'units',len_trim(text),text)
    14631534if (ierr.ne.NF_NOERR) then
    1464   stop "Error: Problem writing units for surface pressure"
     1535  write(*,*) "Error: Problem writing units for surface pressure"
     1536  stop
    14651537endif
    14661538
     
    14801552  ierr=NF_PUT_ATT_TEXT(outfid,za_varid,'long_name',len_trim(text),text)
    14811553  if (ierr.ne.NF_NOERR) then
    1482     stop "Error: Problem writing long_name for zareoid"
     1554    write(*,*) "Error: Problem writing long_name for zareoid"
     1555    stop
    14831556  endif
    14841557  text='m'
    14851558  ierr=NF_PUT_ATT_TEXT(outfid,za_varid,'units',len_trim(text),text)
    14861559  if (ierr.ne.NF_NOERR) then
    1487     stop "Error: Problem writing units for zareoid"
     1560    write(*,*) "Error: Problem writing units for zareoid"
     1561    stop
    14881562  endif
    14891563  ! zareoid missing value
    14901564  ierr=NF_PUT_ATT_REAL(outfid,za_varid,'missing_value',NF_REAL,1,miss_val)
    14911565  if (ierr.ne.NF_NOERR) then
    1492     stop "Error: Problem writing missing_value for zareoid"
     1566    write(*,*) "Error: Problem writing missing_value for zareoid"
     1567    stop
    14931568  endif
    14941569else ! above areoid or above local surface vertical coordinate
     
    15041579  ierr=NF_PUT_ATT_TEXT(outfid,p_varid,'long_name',len_trim(text),text)
    15051580  if (ierr.ne.NF_NOERR) then
    1506     stop "Error: Problem writing long_name for pressure"
     1581    write(*,*) "Error: Problem writing long_name for pressure"
     1582    stop
    15071583  endif
    15081584  text='Pa'
    15091585  ierr=NF_PUT_ATT_TEXT(outfid,p_varid,'units',len_trim(text),text)
    15101586  if (ierr.ne.NF_NOERR) then
    1511     stop "Error: Problem writing units for pressure"
     1587    write(*,*) "Error: Problem writing units for pressure"
     1588    stop
    15121589  endif
    15131590  ! pressure missing value
    15141591  ierr=NF_PUT_ATT_REAL(outfid,p_varid,'missing_value',NF_REAL,1,miss_val)
    15151592  if (ierr.ne.NF_NOERR) then
    1516     stop "Error: Problem writing missing_value for pressure"
     1593    write(*,*) "Error: Problem writing missing_value for pressure"
     1594    stop
    15171595  endif
    15181596endif
     
    15881666      if (ierr.ne.NF_NOERR) then
    15891667        write(*,*) "Error failed to copy title attribute:",trim(text)
    1590       stop ""
     1668      stop
    15911669      endif
    15921670    else ! no 'title' attribute
     
    16111689    if (ierr.ne.NF_NOERR) then
    16121690      write(*,*) "Error failed to copy long_name attribute:",trim(text)
    1613       stop ""
     1691      stop
    16141692    endif
    16151693  endif
     
    16251703    if (ierr.ne.NF_NOERR) then
    16261704      write(*,*) "Error failed to copy units attribute:",trim(text)
    1627       stop ""
     1705      stop
    16281706    endif
    16291707  endif
     
    16411719  ierr=NF_PUT_ATT_REAL(outfid,var_id(i),'missing_value',NF_REAL,1,miss_val)
    16421720  if (ierr.ne.NF_NOERR) then
    1643     stop "Error, failed to write missing_value attribute"
     1721    write(*,*) "Error, failed to write missing_value attribute"
     1722    stop
    16441723  endif
    16451724
     
    17461825
    17471826! Write time
    1748 ierr=NF_PUT_VARA_REAL(outfid,time_varid,1,timelength,time)
     1827ierr=NF_PUT_VARA_REAL(outfid,time_varid,(/1/),(/timelength/),time)
    17491828if (ierr.ne.NF_NOERR) then
    17501829  write(*,*) "Error: Could not write Time data to output file"
Note: See TracChangeset for help on using the changeset viewer.