SUBROUTINE dynredem0(fichnom,idayref,anneeref,phis,nq) use infotrac, only: tname IMPLICIT NONE c======================================================================= c Ecriture du fichier de redemarrage sous format NetCDF (initialisation) c======================================================================= c Declarations: c ------------- #include "dimensions.h" #include "paramet.h" #include "comconst.h" #include "comvert.h" #include "comgeom.h" #include "temps.h" #include "ener.h" #include "logic.h" #include "netcdf.inc" #include "description.h" #include "serre.h" !#include "advtrac.h" c Arguments: c ---------- INTEGER*4 idayref,anneeref REAL phis(ip1jmp1) CHARACTER*(*) fichnom INTEGER nq c Local: c ------ INTEGER iq,l CHARACTER str3*3 INTEGER length PARAMETER (length = 100) REAL tab_cntrl(length) ! tableau des parametres du run INTEGER ierr character*20 modname character*80 abort_message character(len=80) :: txt ! to store some text !REAL hour_ini ! fraction of day of stored date. Equivalent of day_ini, but 0= contra. <--> naturel c ierr = NF_REDEF (nid) dims2(1) = idim_rlonu dims2(2) = idim_rlatu #ifdef NC_DOUBLE ierr = NF_DEF_VAR (nid,"cu",NF_DOUBLE,2,dims2,nvarid) #else ierr = NF_DEF_VAR (nid,"cu",NF_FLOAT,2,dims2,nvarid) #endif ierr = NF_PUT_ATT_TEXT (nid, nvarid, "title", 29, . "Coefficient de passage pour U") ierr = NF_ENDDEF(nid) #ifdef NC_DOUBLE ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,cu) #else ierr = NF_PUT_VAR_REAL (nid,nvarid,cu) #endif c c ---------------------- ierr = NF_REDEF (nid) dims2(1) = idim_rlonv dims2(2) = idim_rlatv #ifdef NC_DOUBLE ierr = NF_DEF_VAR (nid,"cv",NF_DOUBLE,2,dims2,nvarid) #else ierr = NF_DEF_VAR (nid,"cv",NF_FLOAT,2,dims2,nvarid) #endif ierr = NF_PUT_ATT_TEXT (nid, nvarid, "title", 29, . "Coefficient de passage pour V") ierr = NF_ENDDEF(nid) #ifdef NC_DOUBLE ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,cv) #else ierr = NF_PUT_VAR_REAL (nid,nvarid,cv) #endif c c ---------------------- c Aire de chaque maille: c ierr = NF_REDEF (nid) dims2(1) = idim_rlonv dims2(2) = idim_rlatu #ifdef NC_DOUBLE ierr = NF_DEF_VAR (nid,"aire",NF_DOUBLE,2,dims2,nvarid) #else ierr = NF_DEF_VAR (nid,"aire",NF_FLOAT,2,dims2,nvarid) #endif ierr = NF_PUT_ATT_TEXT (nid, nvarid, "title", 22, . "Aires de chaque maille") ierr = NF_ENDDEF(nid) #ifdef NC_DOUBLE ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,aire) #else ierr = NF_PUT_VAR_REAL (nid,nvarid,aire) #endif c c ---------------------- c Geopentiel au sol: c ierr = NF_REDEF (nid) dims2(1) = idim_rlonv dims2(2) = idim_rlatu #ifdef NC_DOUBLE ierr = NF_DEF_VAR (nid,"phisinit",NF_DOUBLE,2,dims2,nvarid) #else ierr = NF_DEF_VAR (nid,"phisinit",NF_FLOAT,2,dims2,nvarid) #endif ierr = NF_PUT_ATT_TEXT (nid, nvarid, "title", 19, . "Geopotentiel au sol") ierr = NF_ENDDEF(nid) #ifdef NC_DOUBLE ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,phis) #else ierr = NF_PUT_VAR_REAL (nid,nvarid,phis) #endif c c ---------------------- c Definir les variables pour pouvoir les enregistrer plus tard: c ierr = NF_REDEF (nid) ! entrer dans le mode de definition if (ierr.ne.NF_NOERR) then write(*,*) "dynredem0: Failed to switch back to define mode" call abort endif #ifdef NC_DOUBLE ierr = NF_DEF_VAR (nid,"Time",NF_DOUBLE,1,idim_tim,nvarid) #else ierr = NF_DEF_VAR (nid,"Time",NF_FLOAT,1,idim_tim,nvarid) #endif if (ierr.ne.NF_NOERR) then write(*,*) "dynredem0: Failed defining