Changeset 1902


Ignore:
Timestamp:
Nov 19, 2013, 12:40:39 PM (11 years ago)
Author:
musat
Message:

Ajout verifs fichiers de guidage et noms variables
IM

Location:
LMDZ5/trunk/libf
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • LMDZ5/trunk/libf/dyn3d/guide_mod.F90

    r1720 r1902  
    143143    ncidpl=-99
    144144    if (guide_modele) then
    145        if (ncidpl.eq.-99) rcod=nf90_open('apbp.nc',Nf90_NOWRITe, ncidpl)
     145       if (ncidpl.eq.-99) then
     146          rcod=nf90_open('apbp.nc',Nf90_NOWRITe, ncidpl)
     147          if (rcod.NE.NF_NOERR) THEN
     148             print *,'Guide: probleme -> pas de fichier apbp.nc'
     149             CALL abort_gcm(modname,abort_message,1)
     150          endif
     151       endif
    146152    else
    147153         if (guide_u) then
    148            if (ncidpl.eq.-99) rcod=nf90_open('u.nc',Nf90_NOWRITe,ncidpl)
     154           if (ncidpl.eq.-99) then
     155               rcod=nf90_open('u.nc',Nf90_NOWRITe,ncidpl)
     156               if (rcod.NE.NF_NOERR) THEN
     157                  print *,'Guide: probleme -> pas de fichier u.nc'
     158                  CALL abort_gcm(modname,abort_message,1)
     159               endif
     160           endif
    149161         elseif (guide_v) then
    150            if (ncidpl.eq.-99) rcod=nf90_open('v.nc',nf90_nowrite,ncidpl)
     162           if (ncidpl.eq.-99) then
     163               rcod=nf90_open('v.nc',nf90_nowrite,ncidpl)
     164               if (rcod.NE.NF_NOERR) THEN
     165                  print *,'Guide: probleme -> pas de fichier v.nc'
     166                  CALL abort_gcm(modname,abort_message,1)
     167               endif
     168           endif
    151169         elseif (guide_T) then
    152            if (ncidpl.eq.-99) rcod=nf90_open('T.nc',nf90_nowrite,ncidpl)
     170           if (ncidpl.eq.-99) then
     171               rcod=nf90_open('T.nc',nf90_nowrite,ncidpl)
     172               if (rcod.NE.NF_NOERR) THEN
     173                  print *,'Guide: probleme -> pas de fichier T.nc'
     174                  CALL abort_gcm(modname,abort_message,1)
     175               endif
     176           endif
    153177         elseif (guide_Q) then
    154            if (ncidpl.eq.-99) rcod=nf90_open('hur.nc',nf90_nowrite, ncidpl)
     178           if (ncidpl.eq.-99) then
     179               rcod=nf90_open('hur.nc',nf90_nowrite, ncidpl)
     180               if (rcod.NE.NF_NOERR) THEN
     181                  print *,'Guide: probleme -> pas de fichier hur.nc'
     182                  CALL abort_gcm(modname,abort_message,1)
     183               endif
     184           endif
    155185         endif
    156186    endif
     
    9901020    INTEGER               :: status,rcode
    9911021
     1022    CHARACTER (len = 80)   :: abort_message
     1023    CHARACTER (len = 20)   :: modname = 'guide_read'
    9921024! -----------------------------------------------------------------
    9931025! Premier appel: initialisation de la lecture des fichiers
     
    9981030! Niveaux de pression si non constants
    9991031         if (guide_modele) then
    1000              print *,'Lecture du guidage sur niveaux modle'
     1032             print *,'Lecture du guidage sur niveaux modele'
    10011033             rcode = nf90_open('apbp.nc', nf90_nowrite, ncidpl)
     1034             IF (rcode.NE.NF_NOERR) THEN
     1035              print *,'Guide: probleme -> pas de fichier apbp.nc'
     1036              CALL abort_gcm(modname,abort_message,1)
     1037             ENDIF
    10021038             rcode = nf90_inq_varid(ncidpl, 'AP', varidap)
     1039             IF (rcode.NE.NF_NOERR) THEN
     1040              print *,'Guide: probleme -> pas de variable AP, fichier apbp.nc'
     1041              CALL abort_gcm(modname,abort_message,1)
     1042             ENDIF
    10031043             rcode = nf90_inq_varid(ncidpl, 'BP', varidbp)
     1044             IF (rcode.NE.NF_NOERR) THEN
     1045              print *,'Guide: probleme -> pas de variable BP, fichier apbp.nc'
     1046              CALL abort_gcm(modname,abort_message,1)
     1047             ENDIF
    10041048             print*,'ncidpl,varidap',ncidpl,varidap
    10051049         endif
     
    10071051         if (guide_u) then
    10081052             rcode = nf90_open('u.nc', nf90_nowrite, ncidu)
     1053             IF (rcode.NE.NF_NOERR) THEN
     1054              print *,'Guide: probleme -> pas de fichier u.nc'
     1055              CALL abort_gcm(modname,abort_message,1)
     1056             ENDIF
    10091057             rcode = nf90_inq_varid(ncidu, 'UWND', varidu)
     1058             IF (rcode.NE.NF_NOERR) THEN
     1059              print *,'Guide: probleme -> pas de variable UWND, fichier u.nc'
     1060              CALL abort_gcm(modname,abort_message,1)
     1061             ENDIF
    10101062             print*,'ncidu,varidu',ncidu,varidu
    10111063             if (ncidpl.eq.-99) ncidpl=ncidu
     
    10141066         if (guide_v) then
    10151067             rcode = nf90_open('v.nc', nf90_nowrite, ncidv)
     1068             IF (rcode.NE.NF_NOERR) THEN
     1069              print *,'Guide: probleme -> pas de fichier v.nc'
     1070              CALL abort_gcm(modname,abort_message,1)
     1071             ENDIF
    10161072             rcode = nf90_inq_varid(ncidv, 'VWND', varidv)
     1073             IF (rcode.NE.NF_NOERR) THEN
     1074              print *,'Guide: probleme -> pas de variable VWND, fichier v.nc'
     1075              CALL abort_gcm(modname,abort_message,1)
     1076             ENDIF
    10171077             print*,'ncidv,varidv',ncidv,varidv
    10181078             if (ncidpl.eq.-99) ncidpl=ncidv
     
    10211081         if (guide_T) then
    10221082             rcode = nf90_open('T.nc', nf90_nowrite, ncidt)
     1083             IF (rcode.NE.NF_NOERR) THEN
     1084              print *,'Guide: probleme -> pas de fichier T.nc'
     1085              CALL abort_gcm(modname,abort_message,1)
     1086             ENDIF
    10231087             rcode = nf90_inq_varid(ncidt, 'AIR', varidt)
     1088             IF (rcode.NE.NF_NOERR) THEN
     1089              print *,'Guide: probleme -> pas de variable AIR, fichier T.nc'
     1090              CALL abort_gcm(modname,abort_message,1)
     1091             ENDIF
    10241092             print*,'ncidT,varidT',ncidt,varidt
    10251093             if (ncidpl.eq.-99) ncidpl=ncidt
     
    10281096         if (guide_Q) then
    10291097             rcode = nf90_open('hur.nc', nf90_nowrite, ncidQ)
     1098             IF (rcode.NE.NF_NOERR) THEN
     1099              print *,'Guide: probleme -> pas de fichier hur.nc'
     1100              CALL abort_gcm(modname,abort_message,1)
     1101             ENDIF
    10301102             rcode = nf90_inq_varid(ncidQ, 'RH', varidQ)
     1103             IF (rcode.NE.NF_NOERR) THEN
     1104              print *,'Guide: probleme -> pas de variable RH, fichier hur.nc'
     1105              CALL abort_gcm(modname,abort_message,1)
     1106             ENDIF
    10311107             print*,'ncidQ,varidQ',ncidQ,varidQ
    10321108             if (ncidpl.eq.-99) ncidpl=ncidQ
     
    10351111         if ((guide_P).OR.(guide_modele)) then
    10361112             rcode = nf90_open('ps.nc', nf90_nowrite, ncidps)
     1113             IF (rcode.NE.NF_NOERR) THEN
     1114              print *,'Guide: probleme -> pas de fichier ps.nc'
     1115              CALL abort_gcm(modname,abort_message,1)
     1116             ENDIF
    10371117             rcode = nf90_inq_varid(ncidps, 'SP', varidps)
     1118             IF (rcode.NE.NF_NOERR) THEN
     1119              print *,'Guide: probleme -> pas de variable SP, fichier ps.nc'
     1120              CALL abort_gcm(modname,abort_message,1)
     1121             ENDIF
    10381122             print*,'ncidps,varidps',ncidps,varidps
    10391123         endif
     
    11731257    INTEGER               :: i
    11741258
     1259    CHARACTER (len = 80)   :: abort_message
     1260    CHARACTER (len = 20)   :: modname = 'guide_read2D'
    11751261! -----------------------------------------------------------------
    11761262! Premier appel: initialisation de la lecture des fichiers
     
    11811267! Niveaux de pression si non constants
    11821268         if (guide_modele) then
    1183              print *,'Lecture du guidage sur niveaux modle'
     1269             print *,'Lecture du guidage sur niveaux modele'
    11841270             rcode = nf90_open('apbp.nc', nf90_nowrite, ncidpl)
     1271             IF (rcode.NE.NF_NOERR) THEN
     1272              print *,'Guide: probleme -> pas de fichier apbp.nc'
     1273              CALL abort_gcm(modname,abort_message,1)
     1274             ENDIF
    11851275             rcode = nf90_inq_varid(ncidpl, 'AP', varidap)
     1276             IF (rcode.NE.NF_NOERR) THEN
     1277              print *,'Guide: probleme -> pas de variable AP, fichier apbp.nc'
     1278              CALL abort_gcm(modname,abort_message,1)
     1279             ENDIF
    11861280             rcode = nf90_inq_varid(ncidpl, 'BP', varidbp)
     1281             IF (rcode.NE.NF_NOERR) THEN
     1282              print *,'Guide: probleme -> pas de variable BP, fichier apbp.nc'
     1283              CALL abort_gcm(modname,abort_message,1)
     1284             ENDIF
    11871285             print*,'ncidpl,varidap',ncidpl,varidap
    11881286         endif
     
    11901288         if (guide_u) then
    11911289             rcode = nf90_open('u.nc', nf90_nowrite, ncidu)
     1290             IF (rcode.NE.NF_NOERR) THEN
     1291              print *,'Guide: probleme -> pas de fichier u.nc'
     1292              CALL abort_gcm(modname,abort_message,1)
     1293             ENDIF
    11921294             rcode = nf90_inq_varid(ncidu, 'UWND', varidu)
     1295             IF (rcode.NE.NF_NOERR) THEN
     1296              print *,'Guide: probleme -> pas de variable UWND, fichier u.nc'
     1297              CALL abort_gcm(modname,abort_message,1)
     1298             ENDIF
    11931299             print*,'ncidu,varidu',ncidu,varidu
    11941300             if (ncidpl.eq.-99) ncidpl=ncidu
     
    11971303         if (guide_v) then
    11981304             rcode = nf90_open('v.nc', nf90_nowrite, ncidv)
     1305             IF (rcode.NE.NF_NOERR) THEN
     1306              print *,'Guide: probleme -> pas de fichier v.nc'
     1307              CALL abort_gcm(modname,abort_message,1)
     1308             ENDIF
    11991309             rcode = nf90_inq_varid(ncidv, 'VWND', varidv)
     1310             IF (rcode.NE.NF_NOERR) THEN
     1311              print *,'Guide: probleme -> pas de variable VWND, fichier v.nc'
     1312              CALL abort_gcm(modname,abort_message,1)
     1313             ENDIF
    12001314             print*,'ncidv,varidv',ncidv,varidv
    12011315             if (ncidpl.eq.-99) ncidpl=ncidv
     
    12041318         if (guide_T) then
    12051319             rcode = nf90_open('T.nc', nf90_nowrite, ncidt)
     1320             IF (rcode.NE.NF_NOERR) THEN
     1321              print *,'Guide: probleme -> pas de fichier T.nc'
     1322              CALL abort_gcm(modname,abort_message,1)
     1323             ENDIF
    12061324             rcode = nf90_inq_varid(ncidt, 'AIR', varidt)
     1325             IF (rcode.NE.NF_NOERR) THEN
     1326              print *,'Guide: probleme -> pas de variable AIR, fichier T.nc'
     1327              CALL abort_gcm(modname,abort_message,1)
     1328             ENDIF
    12071329             print*,'ncidT,varidT',ncidt,varidt
    12081330             if (ncidpl.eq.-99) ncidpl=ncidt
     
    12111333         if (guide_Q) then
    12121334             rcode = nf90_open('hur.nc', nf90_nowrite, ncidQ)
     1335             IF (rcode.NE.NF_NOERR) THEN
     1336              print *,'Guide: probleme -> pas de fichier hur.nc'
     1337              CALL abort_gcm(modname,abort_message,1)
     1338             ENDIF
    12131339             rcode = nf90_inq_varid(ncidQ, 'RH', varidQ)
     1340             IF (rcode.NE.NF_NOERR) THEN
     1341              print *,'Guide: probleme -> pas de variable RH, fichier hur.nc'
     1342              CALL abort_gcm(modname,abort_message,1)
     1343             ENDIF
    12141344             print*,'ncidQ,varidQ',ncidQ,varidQ
    12151345             if (ncidpl.eq.-99) ncidpl=ncidQ
     
    12181348         if ((guide_P).OR.(guide_modele)) then
    12191349             rcode = nf90_open('ps.nc', nf90_nowrite, ncidps)
     1350             IF (rcode.NE.NF_NOERR) THEN
     1351              print *,'Guide: probleme -> pas de fichier ps.nc'
     1352              CALL abort_gcm(modname,abort_message,1)
     1353             ENDIF
    12201354             rcode = nf90_inq_varid(ncidps, 'SP', varidps)
     1355             IF (rcode.NE.NF_NOERR) THEN
     1356              print *,'Guide: probleme -> pas de variable SP, fichier ps.nc'
     1357              CALL abort_gcm(modname,abort_message,1)
     1358             ENDIF
    12211359             print*,'ncidps,varidps',ncidps,varidps
    12221360         endif
  • LMDZ5/trunk/libf/dyn3dmem/guide_loc_mod.F90

    r1848 r1902  
    156156    ncidpl=-99
    157157    if (guide_plevs.EQ.1) then
    158        if (ncidpl.eq.-99) rcod=nf90_open('apbp.nc',Nf90_NOWRITe, ncidpl)
     158       if (ncidpl.eq.-99) then
     159          rcod=nf90_open('apbp.nc',Nf90_NOWRITe, ncidpl)
     160          if (rcod.NE.NF_NOERR) THEN
     161             print *,'Guide: probleme -> pas de fichier apbp.nc'
     162             CALL abort_gcm(modname,abort_message,1)
     163          endif
     164       endif
    159165    elseif (guide_plevs.EQ.2) then
    160        if (ncidpl.EQ.-99) rcod=nf90_open('P.nc',Nf90_NOWRITe,ncidpl)
     166       if (ncidpl.EQ.-99) then
     167          rcod=nf90_open('P.nc',Nf90_NOWRITe,ncidpl)
     168          if (rcod.NE.NF_NOERR) THEN
     169             print *,'Guide: probleme -> pas de fichier P.nc'
     170             CALL abort_gcm(modname,abort_message,1)
     171          endif
     172       endif
    161173    elseif (guide_u) then
    162        if (ncidpl.eq.-99) rcod=nf90_open('u.nc',Nf90_NOWRITe,ncidpl)
     174       if (ncidpl.eq.-99) then
     175          rcod=nf90_open('u.nc',Nf90_NOWRITe,ncidpl)
     176          if (rcod.NE.NF_NOERR) THEN
     177             print *,'Guide: probleme -> pas de fichier u.nc'
     178             CALL abort_gcm(modname,abort_message,1)
     179          endif
     180       endif
    163181    elseif (guide_v) then
    164        if (ncidpl.eq.-99) rcod=nf90_open('v.nc',nf90_nowrite,ncidpl)
     182       if (ncidpl.eq.-99) then
     183          rcod=nf90_open('v.nc',nf90_nowrite,ncidpl)
     184          if (rcod.NE.NF_NOERR) THEN
     185             print *,'Guide: probleme -> pas de fichier v.nc'
     186             CALL abort_gcm(modname,abort_message,1)
     187          endif
     188       endif
    165189    elseif (guide_T) then
    166        if (ncidpl.eq.-99) rcod=nf90_open('T.nc',nf90_nowrite,ncidpl)
     190       if (ncidpl.eq.-99) then
     191          rcod=nf90_open('T.nc',nf90_nowrite,ncidpl)
     192          if (rcod.NE.NF_NOERR) THEN
     193             print *,'Guide: probleme -> pas de fichier T.nc'
     194             CALL abort_gcm(modname,abort_message,1)
     195          endif
     196       endif
    167197    elseif (guide_Q) then
    168        if (ncidpl.eq.-99) rcod=nf90_open('hur.nc',nf90_nowrite, ncidpl)
     198       if (ncidpl.eq.-99) then
     199          rcod=nf90_open('hur.nc',nf90_nowrite, ncidpl)
     200          if (rcod.NE.NF_NOERR) THEN
     201             print *,'Guide: probleme -> pas de fichier hur.nc'
     202             CALL abort_gcm(modname,abort_message,1)
     203          endif
     204       endif
    169205    endif
    170206    error=NF_INQ_DIMID(ncidpl,'LEVEL',rid)
     
    15421578             print *,'Lecture du guidage sur niveaux modele'
    15431579             rcode = nf90_open('apbp.nc', nf90_nowrite, ncidpl)
     1580             IF (rcode.NE.NF_NOERR) THEN
     1581              print *,'Guide: probleme -> pas de fichier apbp.nc'
     1582              CALL abort_gcm(modname,abort_message,1)
     1583             ENDIF
    15441584             rcode = nf90_inq_varid(ncidpl, 'AP', varidap)
     1585             IF (rcode.NE.NF_NOERR) THEN
     1586              print *,'Guide: probleme -> pas de variable AP, fichier apbp.nc'
     1587              CALL abort_gcm(modname,abort_message,1)
     1588             ENDIF
    15451589             rcode = nf90_inq_varid(ncidpl, 'BP', varidbp)
     1590             IF (rcode.NE.NF_NOERR) THEN
     1591              print *,'Guide: probleme -> pas de variable BP, fichier apbp.nc'
     1592              CALL abort_gcm(modname,abort_message,1)
     1593             ENDIF
    15461594             print*,'ncidpl,varidap',ncidpl,varidap
    15471595         endif
     
    15491597         if (guide_plevs.EQ.2) then
    15501598             rcode = nf90_open('P.nc', nf90_nowrite, ncidp)
     1599             IF (rcode.NE.NF_NOERR) THEN
     1600              print *,'Guide: probleme -> pas de fichier P.nc'
     1601              CALL abort_gcm(modname,abort_message,1)
     1602             ENDIF
    15511603             rcode = nf90_inq_varid(ncidp, 'PRES', varidp)
     1604             IF (rcode.NE.NF_NOERR) THEN
     1605              print *,'Guide: probleme -> pas de variable PRES, fichier P.nc'
     1606              CALL abort_gcm(modname,abort_message,1)
     1607             ENDIF
    15521608             print*,'ncidp,varidp',ncidp,varidp
    15531609             if (ncidpl.eq.-99) ncidpl=ncidp
     
    15561612         if (guide_u) then
    15571613             rcode = nf90_open('u.nc', nf90_nowrite, ncidu)
     1614             IF (rcode.NE.NF_NOERR) THEN
     1615              print *,'Guide: probleme -> pas de fichier u.nc'
     1616              CALL abort_gcm(modname,abort_message,1)
     1617             ENDIF
    15581618             rcode = nf90_inq_varid(ncidu, 'UWND', varidu)
     1619             IF (rcode.NE.NF_NOERR) THEN
     1620              print *,'Guide: probleme -> pas de variable UWND, fichier u.nc'
     1621              CALL abort_gcm(modname,abort_message,1)
     1622             ENDIF
    15591623             print*,'ncidu,varidu',ncidu,varidu
    15601624             if (ncidpl.eq.-99) ncidpl=ncidu
     
    15631627         if (guide_v) then
    15641628             rcode = nf90_open('v.nc', nf90_nowrite, ncidv)
     1629             IF (rcode.NE.NF_NOERR) THEN
     1630              print *,'Guide: probleme -> pas de fichier v.nc'
     1631              CALL abort_gcm(modname,abort_message,1)
     1632             ENDIF
    15651633             rcode = nf90_inq_varid(ncidv, 'VWND', varidv)
     1634             IF (rcode.NE.NF_NOERR) THEN
     1635              print *,'Guide: probleme -> pas de variable VWND, fichier v.nc'
     1636              CALL abort_gcm(modname,abort_message,1)
     1637             ENDIF
    15661638             print*,'ncidv,varidv',ncidv,varidv
    15671639             if (ncidpl.eq.-99) ncidpl=ncidv
     
    15701642         if (guide_T) then
    15711643             rcode = nf90_open('T.nc', nf90_nowrite, ncidt)
     1644             IF (rcode.NE.NF_NOERR) THEN
     1645              print *,'Guide: probleme -> pas de fichier T.nc'
     1646              CALL abort_gcm(modname,abort_message,1)
     1647             ENDIF
    15721648             rcode = nf90_inq_varid(ncidt, 'AIR', varidt)
     1649             IF (rcode.NE.NF_NOERR) THEN
     1650              print *,'Guide: probleme -> pas de variable AIR, fichier T.nc'
     1651              CALL abort_gcm(modname,abort_message,1)
     1652             ENDIF
    15731653             print*,'ncidT,varidT',ncidt,varidt
    15741654             if (ncidpl.eq.-99) ncidpl=ncidt
     
    15771657         if (guide_Q) then
    15781658             rcode = nf90_open('hur.nc', nf90_nowrite, ncidQ)
     1659             IF (rcode.NE.NF_NOERR) THEN
     1660              print *,'Guide: probleme -> pas de fichier hur.nc'
     1661              CALL abort_gcm(modname,abort_message,1)
     1662             ENDIF
    15791663             rcode = nf90_inq_varid(ncidQ, 'RH', varidQ)
     1664             IF (rcode.NE.NF_NOERR) THEN
     1665              print *,'Guide: probleme -> pas de variable RH, fichier hur.nc'
     1666              CALL abort_gcm(modname,abort_message,1)
     1667             ENDIF
    15801668             print*,'ncidQ,varidQ',ncidQ,varidQ
    15811669             if (ncidpl.eq.-99) ncidpl=ncidQ
     
    15841672         if ((guide_P).OR.(guide_plevs.EQ.1)) then
    15851673             rcode = nf90_open('ps.nc', nf90_nowrite, ncidps)
     1674             IF (rcode.NE.NF_NOERR) THEN
     1675              print *,'Guide: probleme -> pas de fichier ps.nc'
     1676              CALL abort_gcm(modname,abort_message,1)
     1677             ENDIF
    15861678             rcode = nf90_inq_varid(ncidps, 'SP', varidps)
     1679             IF (rcode.NE.NF_NOERR) THEN
     1680              print *,'Guide: probleme -> pas de variable SP, fichier ps.nc'
     1681              CALL abort_gcm(modname,abort_message,1)
     1682             ENDIF
    15871683             print*,'ncidps,varidps',ncidps,varidps
    15881684         endif
     
    17661862             print *,'Lecture du guidage sur niveaux mod�le'
    17671863             rcode = nf90_open('apbp.nc', nf90_nowrite, ncidpl)
     1864             IF (rcode.NE.NF_NOERR) THEN
     1865              print *,'Guide: probleme -> pas de fichier apbp.nc'
     1866              CALL abort_gcm(modname,abort_message,1)
     1867             ENDIF
    17681868             rcode = nf90_inq_varid(ncidpl, 'AP', varidap)
     1869             IF (rcode.NE.NF_NOERR) THEN
     1870              print *,'Guide: probleme -> pas de variable AP, fichier apbp.nc'
     1871              CALL abort_gcm(modname,abort_message,1)
     1872             ENDIF
    17691873             rcode = nf90_inq_varid(ncidpl, 'BP', varidbp)
     1874             IF (rcode.NE.NF_NOERR) THEN
     1875              print *,'Guide: probleme -> pas de variable BP, fichier apbp.nc'
     1876              CALL abort_gcm(modname,abort_message,1)
     1877             ENDIF
    17701878             print*,'ncidpl,varidap',ncidpl,varidap
    17711879         endif
     
    17731881         if (guide_plevs.EQ.2) then
    17741882             rcode = nf90_open('P.nc', nf90_nowrite, ncidp)
     1883             IF (rcode.NE.NF_NOERR) THEN
     1884              print *,'Guide: probleme -> pas de fichier P.nc'
     1885              CALL abort_gcm(modname,abort_message,1)
     1886             ENDIF
    17751887             rcode = nf90_inq_varid(ncidp, 'PRES', varidp)
     1888             IF (rcode.NE.NF_NOERR) THEN
     1889              print *,'Guide: probleme -> pas de variable PRES, fichier P.nc'
     1890              CALL abort_gcm(modname,abort_message,1)
     1891             ENDIF
    17761892             print*,'ncidp,varidp',ncidp,varidp
    17771893             if (ncidpl.eq.-99) ncidpl=ncidp
     
    17801896         if (guide_u) then
    17811897             rcode = nf90_open('u.nc', nf90_nowrite, ncidu)
     1898             IF (rcode.NE.NF_NOERR) THEN
     1899              print *,'Guide: probleme -> pas de fichier u.nc'
     1900              CALL abort_gcm(modname,abort_message,1)
     1901             ENDIF
    17821902             rcode = nf90_inq_varid(ncidu, 'UWND', varidu)
     1903             IF (rcode.NE.NF_NOERR) THEN
     1904              print *,'Guide: probleme -> pas de variable UWND, fichier u.nc'
     1905              CALL abort_gcm(modname,abort_message,1)
     1906             ENDIF
    17831907             print*,'ncidu,varidu',ncidu,varidu
    17841908             if (ncidpl.eq.-99) ncidpl=ncidu
     
    17871911         if (guide_v) then
    17881912             rcode = nf90_open('v.nc', nf90_nowrite, ncidv)
     1913             IF (rcode.NE.NF_NOERR) THEN
     1914              print *,'Guide: probleme -> pas de fichier v.nc'
     1915              CALL abort_gcm(modname,abort_message,1)
     1916             ENDIF
    17891917             rcode = nf90_inq_varid(ncidv, 'VWND', varidv)
     1918             IF (rcode.NE.NF_NOERR) THEN
     1919              print *,'Guide: probleme -> pas de variable VWND, fichier v.nc'
     1920              CALL abort_gcm(modname,abort_message,1)
     1921             ENDIF
    17901922             print*,'ncidv,varidv',ncidv,varidv
    17911923             if (ncidpl.eq.-99) ncidpl=ncidv
     
    17941926         if (guide_T) then
    17951927             rcode = nf90_open('T.nc', nf90_nowrite, ncidt)
     1928             IF (rcode.NE.NF_NOERR) THEN
     1929              print *,'Guide: probleme -> pas de fichier T.nc'
     1930              CALL abort_gcm(modname,abort_message,1)
     1931             ENDIF
    17961932             rcode = nf90_inq_varid(ncidt, 'AIR', varidt)
     1933             IF (rcode.NE.NF_NOERR) THEN
     1934              print *,'Guide: probleme -> pas de variable AIR, fichier T.nc'
     1935              CALL abort_gcm(modname,abort_message,1)
     1936             ENDIF
    17971937             print*,'ncidT,varidT',ncidt,varidt
    17981938             if (ncidpl.eq.-99) ncidpl=ncidt
     
    18011941         if (guide_Q) then
    18021942             rcode = nf90_open('hur.nc', nf90_nowrite, ncidQ)
     1943             IF (rcode.NE.NF_NOERR) THEN
     1944              print *,'Guide: probleme -> pas de fichier hur.nc'
     1945              CALL abort_gcm(modname,abort_message,1)
     1946             ENDIF
    18031947             rcode = nf90_inq_varid(ncidQ, 'RH', varidQ)
     1948             IF (rcode.NE.NF_NOERR) THEN
     1949              print *,'Guide: probleme -> pas de variable RH, fichier hur.nc'
     1950              CALL abort_gcm(modname,abort_message,1)
     1951             ENDIF
    18041952             print*,'ncidQ,varidQ',ncidQ,varidQ
    18051953             if (ncidpl.eq.-99) ncidpl=ncidQ
     
    18081956         if ((guide_P).OR.(guide_plevs.EQ.1)) then
    18091957             rcode = nf90_open('ps.nc', nf90_nowrite, ncidps)
     1958             IF (rcode.NE.NF_NOERR) THEN
     1959              print *,'Guide: probleme -> pas de fichier ps.nc'
     1960              CALL abort_gcm(modname,abort_message,1)
     1961             ENDIF
    18101962             rcode = nf90_inq_varid(ncidps, 'SP', varidps)
     1963             IF (rcode.NE.NF_NOERR) THEN
     1964              print *,'Guide: probleme -> pas de variable SP, fichier ps.nc'
     1965              CALL abort_gcm(modname,abort_message,1)
     1966             ENDIF
    18111967             print*,'ncidps,varidps',ncidps,varidps
    18121968         endif
  • LMDZ5/trunk/libf/dyn3dpar/guide_p_mod.F90

    r1823 r1902  
    155155    ncidpl=-99
    156156    if (guide_plevs.EQ.1) then
    157        if (ncidpl.eq.-99) rcod=nf90_open('apbp.nc',Nf90_NOWRITe, ncidpl)
     157       if (ncidpl.eq.-99) then
     158          rcod=nf90_open('apbp.nc',Nf90_NOWRITe, ncidpl)
     159          if (rcod.NE.NF_NOERR) THEN
     160             print *,'Guide: probleme -> pas de fichier apbp.nc'
     161             CALL abort_gcm(modname,abort_message,1)
     162          endif
     163       endif
    158164    elseif (guide_plevs.EQ.2) then
    159        if (ncidpl.EQ.-99) rcod=nf90_open('P.nc',Nf90_NOWRITe,ncidpl)
     165       if (ncidpl.EQ.-99) then
     166          rcod=nf90_open('P.nc',Nf90_NOWRITe,ncidpl)
     167          if (rcod.NE.NF_NOERR) THEN
     168             print *,'Guide: probleme -> pas de fichier P.nc'
     169             CALL abort_gcm(modname,abort_message,1)
     170          endif
     171       endif
    160172    elseif (guide_u) then
    161        if (ncidpl.eq.-99) rcod=nf90_open('u.nc',Nf90_NOWRITe,ncidpl)
     173       if (ncidpl.eq.-99) then
     174          rcod=nf90_open('u.nc',Nf90_NOWRITe,ncidpl)
     175          if (rcod.NE.NF_NOERR) THEN
     176             print *,'Guide: probleme -> pas de fichier u.nc'
     177             CALL abort_gcm(modname,abort_message,1)
     178          endif
     179       endif
    162180    elseif (guide_v) then
    163        if (ncidpl.eq.-99) rcod=nf90_open('v.nc',nf90_nowrite,ncidpl)
     181       if (ncidpl.eq.-99) then
     182          rcod=nf90_open('v.nc',nf90_nowrite,ncidpl)
     183          if (rcod.NE.NF_NOERR) THEN
     184             print *,'Guide: probleme -> pas de fichier v.nc'
     185             CALL abort_gcm(modname,abort_message,1)
     186          endif
     187       endif
    164188    elseif (guide_T) then
    165        if (ncidpl.eq.-99) rcod=nf90_open('T.nc',nf90_nowrite,ncidpl)
     189       if (ncidpl.eq.-99) then
     190          rcod=nf90_open('T.nc',nf90_nowrite,ncidpl)
     191          if (rcod.NE.NF_NOERR) THEN
     192             print *,'Guide: probleme -> pas de fichier T.nc'
     193             CALL abort_gcm(modname,abort_message,1)
     194          endif
     195       endif
    166196    elseif (guide_Q) then
    167        if (ncidpl.eq.-99) rcod=nf90_open('hur.nc',nf90_nowrite, ncidpl)
     197       if (ncidpl.eq.-99) then
     198          rcod=nf90_open('hur.nc',nf90_nowrite, ncidpl)
     199          if (rcod.NE.NF_NOERR) THEN
     200             print *,'Guide: probleme -> pas de fichier hur.nc'
     201             CALL abort_gcm(modname,abort_message,1)
     202          endif
     203       endif
    168204    endif
    169205    error=NF_INQ_DIMID(ncidpl,'LEVEL',rid)
     
    12311267    INTEGER               :: status,rcode
    12321268
     1269    CHARACTER (len = 80)   :: abort_message
     1270    CHARACTER (len = 20)   :: modname = 'guide_init'
    12331271! -----------------------------------------------------------------
    12341272! Premier appel: initialisation de la lecture des fichiers
     
    12411279             print *,'Lecture du guidage sur niveaux modele'
    12421280             rcode = nf90_open('apbp.nc', nf90_nowrite, ncidpl)
     1281             IF (rcode.NE.NF_NOERR) THEN
     1282              print *,'Guide: probleme -> pas de fichier apbp.nc'
     1283              CALL abort_gcm(modname,abort_message,1)
     1284             ENDIF
    12431285             rcode = nf90_inq_varid(ncidpl, 'AP', varidap)
     1286             IF (rcode.NE.NF_NOERR) THEN
     1287              print *,'Guide: probleme -> pas de variable AP, fichier apbp.nc'
     1288              CALL abort_gcm(modname,abort_message,1)
     1289             ENDIF
    12441290             rcode = nf90_inq_varid(ncidpl, 'BP', varidbp)
     1291             IF (rcode.NE.NF_NOERR) THEN
     1292              print *,'Guide: probleme -> pas de variable BP, fichier apbp.nc'
     1293              CALL abort_gcm(modname,abort_message,1)
     1294             ENDIF
    12451295             print*,'ncidpl,varidap',ncidpl,varidap
    12461296         endif
     
    12481298         if (guide_plevs.EQ.2) then
    12491299             rcode = nf90_open('P.nc', nf90_nowrite, ncidp)
     1300             IF (rcode.NE.NF_NOERR) THEN
     1301              print *,'Guide: probleme -> pas de fichier P.nc'
     1302              CALL abort_gcm(modname,abort_message,1)
     1303             ENDIF
    12501304             rcode = nf90_inq_varid(ncidp, 'PRES', varidp)
     1305             IF (rcode.NE.NF_NOERR) THEN
     1306              print *,'Guide: probleme -> pas de variable PRES, fichier P.nc'
     1307              CALL abort_gcm(modname,abort_message,1)
     1308             ENDIF
    12511309             print*,'ncidp,varidp',ncidp,varidp
    12521310             if (ncidpl.eq.-99) ncidpl=ncidp
     
    12551313         if (guide_u) then
    12561314             rcode = nf90_open('u.nc', nf90_nowrite, ncidu)
     1315             IF (rcode.NE.NF_NOERR) THEN
     1316              print *,'Guide: probleme -> pas de fichier u.nc'
     1317              CALL abort_gcm(modname,abort_message,1)
     1318             ENDIF
    12571319             rcode = nf90_inq_varid(ncidu, 'UWND', varidu)
     1320             IF (rcode.NE.NF_NOERR) THEN
     1321              print *,'Guide: probleme -> pas de variable UWND, fichier u.nc'
     1322              CALL abort_gcm(modname,abort_message,1)
     1323             ENDIF
    12581324             print*,'ncidu,varidu',ncidu,varidu
    12591325             if (ncidpl.eq.-99) ncidpl=ncidu
     
    12621328         if (guide_v) then
    12631329             rcode = nf90_open('v.nc', nf90_nowrite, ncidv)
     1330             IF (rcode.NE.NF_NOERR) THEN
     1331              print *,'Guide: probleme -> pas de fichier v.nc'
     1332              CALL abort_gcm(modname,abort_message,1)
     1333             ENDIF
    12641334             rcode = nf90_inq_varid(ncidv, 'VWND', varidv)
     1335             IF (rcode.NE.NF_NOERR) THEN
     1336              print *,'Guide: probleme -> pas de variable VWND, fichier v.nc'
     1337              CALL abort_gcm(modname,abort_message,1)
     1338             ENDIF
    12651339             print*,'ncidv,varidv',ncidv,varidv
    12661340             if (ncidpl.eq.-99) ncidpl=ncidv
     
    12691343         if (guide_T) then
    12701344             rcode = nf90_open('T.nc', nf90_nowrite, ncidt)
     1345             IF (rcode.NE.NF_NOERR) THEN
     1346              print *,'Guide: probleme -> pas de fichier T.nc'
     1347              CALL abort_gcm(modname,abort_message,1)
     1348             ENDIF
    12711349             rcode = nf90_inq_varid(ncidt, 'AIR', varidt)
     1350             IF (rcode.NE.NF_NOERR) THEN
     1351              print *,'Guide: probleme -> pas de variable AIR, fichier T.nc'
     1352              CALL abort_gcm(modname,abort_message,1)
     1353             ENDIF
    12721354             print*,'ncidT,varidT',ncidt,varidt
    12731355             if (ncidpl.eq.-99) ncidpl=ncidt
     
    12761358         if (guide_Q) then
    12771359             rcode = nf90_open('hur.nc', nf90_nowrite, ncidQ)
     1360             IF (rcode.NE.NF_NOERR) THEN
     1361              print *,'Guide: probleme -> pas de fichier hur.nc'
     1362              CALL abort_gcm(modname,abort_message,1)
     1363             ENDIF
    12781364             rcode = nf90_inq_varid(ncidQ, 'RH', varidQ)
     1365             IF (rcode.NE.NF_NOERR) THEN
     1366              print *,'Guide: probleme -> pas de variable RH, fichier hur.nc'
     1367              CALL abort_gcm(modname,abort_message,1)
     1368             ENDIF
    12791369             print*,'ncidQ,varidQ',ncidQ,varidQ
    12801370             if (ncidpl.eq.-99) ncidpl=ncidQ
     
    12831373         if ((guide_P).OR.(guide_plevs.EQ.1)) then
    12841374             rcode = nf90_open('ps.nc', nf90_nowrite, ncidps)
     1375             IF (rcode.NE.NF_NOERR) THEN
     1376              print *,'Guide: probleme -> pas de fichier ps.nc'
     1377              CALL abort_gcm(modname,abort_message,1)
     1378             ENDIF
    12851379             rcode = nf90_inq_varid(ncidps, 'SP', varidps)
     1380             IF (rcode.NE.NF_NOERR) THEN
     1381              print *,'Guide: probleme -> pas de variable SP, fichier ps.nc'
     1382              CALL abort_gcm(modname,abort_message,1)
     1383             ENDIF
    12861384             print*,'ncidps,varidps',ncidps,varidps
    12871385         endif
     
    14341532    INTEGER               :: i
    14351533
     1534    CHARACTER (len = 80)   :: abort_message
     1535    CHARACTER (len = 20)   :: modname = 'guide_init'
    14361536! -----------------------------------------------------------------
    14371537! Premier appel: initialisation de la lecture des fichiers
     
    14441544             print *,'Lecture du guidage sur niveaux mod�le'
    14451545             rcode = nf90_open('apbp.nc', nf90_nowrite, ncidpl)
     1546             IF (rcode.NE.NF_NOERR) THEN
     1547              print *,'Guide: probleme -> pas de fichier apbp.nc'
     1548              CALL abort_gcm(modname,abort_message,1)
     1549             ENDIF
    14461550             rcode = nf90_inq_varid(ncidpl, 'AP', varidap)
     1551             IF (rcode.NE.NF_NOERR) THEN
     1552              print *,'Guide: probleme -> pas de variable AP, fichier apbp.nc'
     1553              CALL abort_gcm(modname,abort_message,1)
     1554             ENDIF
    14471555             rcode = nf90_inq_varid(ncidpl, 'BP', varidbp)
     1556             IF (rcode.NE.NF_NOERR) THEN
     1557              print *,'Guide: probleme -> pas de variable BP, fichier apbp.nc'
     1558              CALL abort_gcm(modname,abort_message,1)
     1559             ENDIF
    14481560             print*,'ncidpl,varidap',ncidpl,varidap
    14491561         endif
     
    14511563         if (guide_plevs.EQ.2) then
    14521564             rcode = nf90_open('P.nc', nf90_nowrite, ncidp)
     1565             IF (rcode.NE.NF_NOERR) THEN
     1566              print *,'Guide: probleme -> pas de fichier P.nc'
     1567              CALL abort_gcm(modname,abort_message,1)
     1568             ENDIF
    14531569             rcode = nf90_inq_varid(ncidp, 'PRES', varidp)
     1570             IF (rcode.NE.NF_NOERR) THEN
     1571              print *,'Guide: probleme -> pas de variable PRES, fichier P.nc'
     1572              CALL abort_gcm(modname,abort_message,1)
     1573             ENDIF
    14541574             print*,'ncidp,varidp',ncidp,varidp
    14551575             if (ncidpl.eq.-99) ncidpl=ncidp
     
    14581578         if (guide_u) then
    14591579             rcode = nf90_open('u.nc', nf90_nowrite, ncidu)
     1580             IF (rcode.NE.NF_NOERR) THEN
     1581              print *,'Guide: probleme -> pas de fichier u.nc'
     1582              CALL abort_gcm(modname,abort_message,1)
     1583             ENDIF
    14601584             rcode = nf90_inq_varid(ncidu, 'UWND', varidu)
     1585             IF (rcode.NE.NF_NOERR) THEN
     1586              print *,'Guide: probleme -> pas de variable UWND, fichier u.nc'
     1587              CALL abort_gcm(modname,abort_message,1)
     1588             ENDIF
    14611589             print*,'ncidu,varidu',ncidu,varidu
    14621590             if (ncidpl.eq.-99) ncidpl=ncidu
     
    14651593         if (guide_v) then
    14661594             rcode = nf90_open('v.nc', nf90_nowrite, ncidv)
     1595             IF (rcode.NE.NF_NOERR) THEN
     1596              print *,'Guide: probleme -> pas de fichier v.nc'
     1597              CALL abort_gcm(modname,abort_message,1)
     1598             ENDIF
    14671599             rcode = nf90_inq_varid(ncidv, 'VWND', varidv)
     1600             IF (rcode.NE.NF_NOERR) THEN
     1601              print *,'Guide: probleme -> pas de variable VWND, fichier v.nc'
     1602              CALL abort_gcm(modname,abort_message,1)
     1603             ENDIF
    14681604             print*,'ncidv,varidv',ncidv,varidv
    14691605             if (ncidpl.eq.-99) ncidpl=ncidv
     
    14721608         if (guide_T) then
    14731609             rcode = nf90_open('T.nc', nf90_nowrite, ncidt)
     1610             IF (rcode.NE.NF_NOERR) THEN
     1611              print *,'Guide: probleme -> pas de fichier T.nc'
     1612              CALL abort_gcm(modname,abort_message,1)
     1613             ENDIF
    14741614             rcode = nf90_inq_varid(ncidt, 'AIR', varidt)
     1615             IF (rcode.NE.NF_NOERR) THEN
     1616              print *,'Guide: probleme -> pas de variable AIR, fichier T.nc'
     1617              CALL abort_gcm(modname,abort_message,1)
     1618             ENDIF
    14751619             print*,'ncidT,varidT',ncidt,varidt
    14761620             if (ncidpl.eq.-99) ncidpl=ncidt
     
    14791623         if (guide_Q) then
    14801624             rcode = nf90_open('hur.nc', nf90_nowrite, ncidQ)
     1625             IF (rcode.NE.NF_NOERR) THEN
     1626              print *,'Guide: probleme -> pas de fichier hur.nc'
     1627              CALL abort_gcm(modname,abort_message,1)
     1628             ENDIF
    14811629             rcode = nf90_inq_varid(ncidQ, 'RH', varidQ)
     1630             IF (rcode.NE.NF_NOERR) THEN
     1631              print *,'Guide: probleme -> pas de variable RH, fichier hur.nc'
     1632              CALL abort_gcm(modname,abort_message,1)
     1633             ENDIF
    14821634             print*,'ncidQ,varidQ',ncidQ,varidQ
    14831635             if (ncidpl.eq.-99) ncidpl=ncidQ
     
    14861638         if ((guide_P).OR.(guide_plevs.EQ.1)) then
    14871639             rcode = nf90_open('ps.nc', nf90_nowrite, ncidps)
     1640             IF (rcode.NE.NF_NOERR) THEN
     1641              print *,'Guide: probleme -> pas de fichier ps.nc'
     1642              CALL abort_gcm(modname,abort_message,1)
     1643             ENDIF
    14881644             rcode = nf90_inq_varid(ncidps, 'SP', varidps)
     1645             IF (rcode.NE.NF_NOERR) THEN
     1646              print *,'Guide: probleme -> pas de variable SP, fichier ps.nc'
     1647              CALL abort_gcm(modname,abort_message,1)
     1648             ENDIF
    14891649             print*,'ncidps,varidps',ncidps,varidps
    14901650         endif
Note: See TracChangeset for help on using the changeset viewer.