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

Ajout verifs fichiers de guidage et noms variables
IM

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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
Note: See TracChangeset for help on using the changeset viewer.