SUBROUTINE dynetat0(fichnom,nq,vcov,ucov, . teta,q,masse,ps,phis,time) IMPLICIT NONE c======================================================================= c c Auteur: P. Le Van / L.Fairhead c ------- c c objet: c ------ c c Lecture de l'etat initial c c Modifs: Oct.2008 read in tracers by name. Ehouarn Millour c c======================================================================= c----------------------------------------------------------------------- c Declarations: c ------------- #include "dimensions.h" #include "paramet.h" #include "temps.h" #include "comconst.h" #include "comvert.h" #include "comgeom.h" #include "ener.h" #include "netcdf.inc" #include "serre.h" #include "logic.h" #include"advtrac.h" c Arguments: c ---------- CHARACTER*(*) fichnom INTEGER nq REAL vcov(ip1jm,llm),ucov(ip1jmp1,llm),teta(ip1jmp1,llm) REAL q(iip1,jjp1,llm,nq),masse(ip1jmp1,llm) REAL ps(ip1jmp1),phis(ip1jmp1) REAL time c Variables c INTEGER length,iq,i,j,l PARAMETER (length = 100) REAL tab_cntrl(length) ! tableau des parametres du run INTEGER ierr, nid, nvarid, nqold CHARACTER str3*3,yes*1 ! added by RW for test real pmean,airetot integer ij c----------------------------------------------------------------------- c Ouverture NetCDF du fichier etat initial ierr = NF_OPEN (fichnom, NF_NOWRITE,nid) IF (ierr.NE.NF_NOERR) THEN write(6,*)' Pb d''ouverture du fichier ',fichnom CALL ABORT ENDIF c ierr = NF_INQ_VARID (nid, "controle", nvarid) IF (ierr .NE. NF_NOERR) THEN PRINT*, "dynetat0: Le champ est absent" CALL abort ENDIF #ifdef NC_DOUBLE ierr = NF_GET_VAR_DOUBLE(nid, nvarid, tab_cntrl) #else ierr = NF_GET_VAR_REAL(nid, nvarid, tab_cntrl) #endif IF (ierr .NE. NF_NOERR) THEN PRINT*, "dynetat0: Lecture echoue pour " CALL abort ENDIF im = tab_cntrl(1) jm = tab_cntrl(2) lllm = tab_cntrl(3) day_ini = tab_cntrl(4) rad = tab_cntrl(5) omeg = tab_cntrl(6) g = tab_cntrl(7) cpp = tab_cntrl(8) kappa = tab_cntrl(9) daysec = tab_cntrl(10) dtvr = tab_cntrl(11) etot0 = tab_cntrl(12) ptot0 = tab_cntrl(13) ztot0 = tab_cntrl(14) stot0 = tab_cntrl(15) ang0 = tab_cntrl(16) pa = tab_cntrl(17) preff = tab_cntrl(18) c clon = tab_cntrl(19) clat = tab_cntrl(20) grossismx = tab_cntrl(21) grossismy = tab_cntrl(22) c IF ( tab_cntrl(23).EQ.1. ) THEN fxyhypb = . TRUE . dzoomx = tab_cntrl(24) dzoomy = tab_cntrl(25) taux = tab_cntrl(27) tauy = tab_cntrl(28) ELSE fxyhypb = . FALSE . ysinus = . FALSE . IF( tab_cntrl(26).EQ.1. ) ysinus = . TRUE. ENDIF c ................................................................. c c PRINT*,'dynetat0: rad,omeg,g,cpp,kappa',rad,omeg,g,cpp,kappa IF( im.ne.iim ) THEN PRINT 1,im,iim STOP ELSE IF( jm.ne.jjm ) THEN PRINT 2,jm,jjm STOP ELSE IF( lllm.ne.llm ) THEN PRINT 3,lllm,llm STOP ENDIF ierr = NF_INQ_VARID (nid, "rlonu", nvarid) IF (ierr .NE. NF_NOERR) THEN PRINT*, "dynetat0: Le champ est absent" CALL abort ENDIF #ifdef NC_DOUBLE ierr = NF_GET_VAR_DOUBLE(nid, nvarid, rlonu) #else ierr = NF_GET_VAR_REAL(nid, nvarid, rlonu) #endif IF (ierr .NE. NF_NOERR) THEN PRINT*, "dynetat0: Lecture echouee pour " CALL abort ENDIF ierr = NF_INQ_VARID (nid, "rlatu", nvarid) IF (ierr .NE. NF_NOERR) THEN PRINT*, "dynetat0: Le champ est absent" CALL abort ENDIF #ifdef NC_DOUBLE ierr = NF_GET_VAR_DOUBLE(nid, nvarid, rlatu) #else ierr = NF_GET_VAR_REAL(nid, nvarid, rlatu) #endif IF (ierr .NE. NF_NOERR) THEN PRINT*, "dynetat0: Lecture echouee pour " CALL abort ENDIF ierr = NF_INQ_VARID (nid, "rlonv", nvarid) IF (ierr .NE. NF_NOERR) THEN PRINT*, "dynetat0: Le champ est absent" CALL abort ENDIF #ifdef NC_DOUBLE ierr = NF_GET_VAR_DOUBLE(nid, nvarid, rlonv) #else ierr = NF_GET_VAR_REAL(nid, nvarid, rlonv) #endif IF (ierr .NE. NF_NOERR) THEN PRINT*, "dynetat0: Lecture echouee pour " CALL abort ENDIF ierr = NF_INQ_VARID (nid, "rlatv", nvarid) IF (ierr .NE. NF_NOERR) THEN PRINT*, "dynetat0: Le champ est absent" CALL abort ENDIF #ifdef NC_DOUBLE ierr = NF_GET_VAR_DOUBLE(nid, nvarid, rlatv) #else ierr = NF_GET_VAR_REAL(nid, nvarid, rlatv) #endif IF (ierr .NE. NF_NOERR) THEN PRINT*, "dynetat0: Lecture echouee pour rlatv" CALL abort ENDIF ierr = NF_INQ_VARID (nid, "cu", nvarid) IF (ierr .NE. NF_NOERR) THEN PRINT*, "dynetat0: Le champ est absent" CALL abort ENDIF #ifdef NC_DOUBLE ierr = NF_GET_VAR_DOUBLE(nid, nvarid, cu) #else ierr = NF_GET_VAR_REAL(nid, nvarid, cu) #endif IF (ierr .NE. NF_NOERR) THEN PRINT*, "dynetat0: Lecture echouee pour " CALL abort ENDIF ierr = NF_INQ_VARID (nid, "cv", nvarid) IF (ierr .NE. NF_NOERR) THEN PRINT*, "dynetat0: Le champ est absent" CALL abort ENDIF #ifdef NC_DOUBLE ierr = NF_GET_VAR_DOUBLE(nid, nvarid, cv) #else ierr = NF_GET_VAR_REAL(nid, nvarid, cv) #endif IF (ierr .NE. NF_NOERR) THEN PRINT*, "dynetat0: Lecture echouee pour " CALL abort ENDIF ierr = NF_INQ_VARID (nid, "aire", nvarid) IF (ierr .NE. NF_NOERR) THEN PRINT*, "dynetat0: Le champ est absent" CALL abort ENDIF #ifdef NC_DOUBLE ierr = NF_GET_VAR_DOUBLE(nid, nvarid, aire) #else ierr = NF_GET_VAR_REAL(nid, nvarid, aire) #endif IF (ierr .NE. NF_NOERR) THEN PRINT*, "dynetat0: Lecture echouee pour " CALL abort ENDIF ierr = NF_INQ_VARID (nid, "phisinit", nvarid) IF (ierr .NE. NF_NOERR) THEN PRINT*, "dynetat0: Le champ est absent" CALL abort ENDIF #ifdef NC_DOUBLE ierr = NF_GET_VAR_DOUBLE(nid, nvarid, phis) #else ierr = NF_GET_VAR_REAL(nid, nvarid, phis) #endif IF (ierr .NE. NF_NOERR) THEN PRINT*, "dynetat0: Lecture echouee pour " CALL abort ENDIF ierr = NF_INQ_VARID (nid, "Time", nvarid) IF (ierr .NE. NF_NOERR) THEN ierr = NF_INQ_VARID (nid, "temps", nvarid) IF (ierr .NE. NF_NOERR) THEN PRINT*, "dynetat0: