subroutine physdem(lonfi, latfi,phystep,radpas,co2_ppm, . solaire, ts, ws, . sn, radsol, deltat, rugmer, . agesno, zmea, zstd, zsig, . zgam, zthe, zpic, zval, . rugsrel) IMPLICIT none c------------------------------------------------------------- C Author : L. Fairhead C Date : 01/10/1999 C Objet : Ecriture des etats initiaux physiques c------------------------------------------------------------- c c c INTEGER ivap PARAMETER (ivap=1) c REAL qsolmax PARAMETER ( qsolmax = 150.0 ) c #include "dimensions.h" #include "paramet.h" c----------------------------------------------------------------------- INTEGER KIDIA, KFDIA, KLON, KLEV PARAMETER (KIDIA=1,KFDIA=iim*(jjm-1)+2, . KLON=KFDIA-KIDIA+1,KLEV=llm) c----------------------------------------------------------------------- #include "comconst.h" #include "comvert.h" #include "comgeom2.h" #include "control.h" #include "comdissnew.h" #include "logic.h" #include "ener.h" #include "netcdf.inc" c INTEGER nid c Ajout de quelques parametres orographiques (F. LOTT janvier 1995) REAL zmea(iip1,jjp1),zstd(iip1,jjp1) REAL zsig(iip1,jjp1),zgam(iip1,jjp1),zthe(iip1,jjp1) REAL zpic(iip1,jjp1),zval(iip1,jjp1) REAL rugsrel(iip1,jjp1) INTEGER idayref,anneeref integer ierr, idim1, idim2, nvarid c REAL phystep INTEGER radpas REAL co2_ppm REAL solaire REAL latfi(klon), lonfi(klon) REAL champhys(klon) REAL ts(klon) REAL deltat(klon) REAL ws(klon) REAL sn(klon) REAL radsol(klon) REAL rugmer(klon) REAL agesno(klon) INTEGER length PARAMETER (length=100) REAL tab_cntrl(length) c EXTERNAL defrun_new,iniconst,geopot,inigeom,massdair,pression EXTERNAL exner_hyb , SSUM c #include "serre.h" #include "clesph0.h" #include "fxyprim.h" c----------------------------------------------------------------------- c c stockage sur le fichier Physique: c ierr = NF_CREATE("startphy.nc", NF_CLOBBER, nid) IF (ierr.NE.NF_NOERR) THEN WRITE(6,*)' Pb d''ouverture du fichier startphy.nc' WRITE(6,*)' ierr = ', ierr CALL ABORT ENDIF c ierr = NF_PUT_ATT_TEXT (nid, NF_GLOBAL, "title", 28, . "Fichier demmarage physique") c ierr = NF_DEF_DIM (nid, "index", length, idim1) ierr = NF_DEF_DIM (nid, "points_physiques", klon, idim2) c ierr = NF_ENDDEF(nid) c DO ierr = 1, length tab_cntrl(ierr) = 0.0 ENDDO tab_cntrl(1) = phystep tab_cntrl(2) = radpas tab_cntrl(3) = co2_ppm tab_cntrl(4) = solaire tab_cntrl(5) = iflag_con tab_cntrl(6) = nbapp_rad c cc Modif ( P. Le Van ) c tab_cntrl( 7 ) = 0. tab_cntrl( 8 ) = 0. tab_cntrl( 9 ) = 0. tab_cntrl(10 ) = 0. tab_cntrl(11 ) = 0. tab_cntrl(12 ) = 0. IF( cycle_diurne ) tab_cntrl( 7 ) = 1. IF( soil_model ) tab_cntrl( 8 ) = 1. IF( new_oliq ) tab_cntrl( 9 ) = 1. IF( ok_orodr ) tab_cntrl(10 ) = 1. IF( ok_orolf ) tab_cntrl(11 ) = 1. IF( ok_limitvrai ) tab_cntrl(12 ) = 1. tab_cntrl(13) = dayref tab_cntrl(14) = anneeref cc *** new_oliq ( commentaires de L. LI dans routine physique ) cc *** ok_orodr et ok_orolf si on appelle l'orographie **** c ierr = NF_REDEF (nid) #ifdef NC_DOUBLE ierr = NF_DEF_VAR (nid, "controle", NF_DOUBLE, 1, idim1,nvarid) #else ierr = NF_DEF_VAR (nid, "controle", NF_FLOAT, 1, idim1,nvarid) #endif ierr = NF_PUT_ATT_TEXT (nid,nvarid,"title", 22, . "Parametres de controle") ierr = NF_ENDDEF(nid) #ifdef NC_DOUBLE ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,tab_cntrl) #else ierr = NF_PUT_VAR_REAL (nid,nvarid,tab_cntrl) #endif c ierr = NF_REDEF (nid) #ifdef NC_DOUBLE ierr = NF_DEF_VAR (nid, "longitude", NF_DOUBLE, 1, idim2,nvarid) #else ierr = NF_DEF_VAR (nid, "longitude", NF_FLOAT, 1, idim2,nvarid) #endif ierr = NF_PUT_ATT_TEXT (nid,nvarid,"title", 32, . "Longitudes de la grille physique") ierr = NF_ENDDEF(nid) #ifdef NC_DOUBLE ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,lonfi) #else ierr = NF_PUT_VAR_REAL (nid,nvarid,lonfi) #endif c ierr = NF_REDEF (nid) #ifdef NC_DOUBLE ierr = NF_DEF_VAR (nid, "latitude", NF_DOUBLE, 1, idim2,nvarid) #else ierr = NF_DEF_VAR (nid, "latitude", NF_FLOAT, 1, idim2,nvarid) #endif ierr = NF_PUT_ATT_TEXT (nid,nvarid,"title", 31, . "Latitudes de la grille physique") ierr = NF_ENDDEF(nid) #ifdef NC_DOUBLE ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,latfi) #else ierr = NF_PUT_VAR_REAL (nid,nvarid,latfi) #endif c ierr = NF_REDEF (nid) #ifdef NC_DOUBLE ierr = NF_DEF_VAR (nid, "TS", NF_DOUBLE, 1, idim2,nvarid) #else ierr = NF_DEF_VAR (nid, "TS", NF_FLOAT, 1, idim2,nvarid) #endif ierr = NF_PUT_ATT_TEXT (nid,nvarid,"title", 25, . "Temperature de la surface") ierr = NF_ENDDEF(nid) #ifdef NC_DOUBLE ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,ts) #else ierr = NF_PUT_VAR_REAL (nid,nvarid,ts) #endif c ierr = NF_REDEF (nid) #ifdef NC_DOUBLE ierr = NF_DEF_VAR (nid, "QS", NF_DOUBLE, 1, idim2,nvarid) #else ierr = NF_DEF_VAR (nid, "QS", NF_FLOAT, 1, idim2,nvarid) #endif ierr = NF_PUT_ATT_TEXT (nid, nvarid, "title", 15, . "Humidite du sol") ierr = NF_ENDDEF(nid) #ifdef NC_DOUBLE ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,ws) #else ierr = NF_PUT_VAR_REAL (nid,nvarid,ws) #endif c ierr = NF_REDEF (nid) #ifdef NC_DOUBLE ierr = NF_DEF_VAR (nid, "SNOW", NF_DOUBLE, 1, idim2,nvarid) #else ierr = NF_DEF_VAR (nid, "SNOW", NF_FLOAT, 1, idim2,nvarid) #endif ierr = NF_PUT_ATT_TEXT (nid, nvarid, "title", 5, . "Neige") ierr = NF_ENDDEF(nid) #ifdef NC_DOUBLE ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,sn) #else ierr = NF_PUT_VAR_REAL (nid,nvarid,sn) #endif c ierr = NF_REDEF (nid) #ifdef NC_DOUBLE ierr = NF_DEF_VAR (nid, "RADS", NF_DOUBLE, 1, idim2,nvarid) #else ierr = NF_DEF_VAR (nid, "RADS", NF_FLOAT, 1, idim2,nvarid) #endif ierr = NF_PUT_ATT_TEXT (nid,nvarid,"title", 28, . "Rayonnement net a la surface") ierr = NF_ENDDEF(nid) #ifdef NC_DOUBLE ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,radsol) #else ierr = NF_PUT_VAR_REAL (nid,nvarid,radsol) #endif c ierr = NF_REDEF (nid) #ifdef NC_DOUBLE ierr = NF_DEF_VAR (nid, "DELTAT", NF_DOUBLE, 1, idim2,nvarid) #else ierr = NF_DEF_VAR (nid, "DELTAT", NF_FLOAT, 1, idim2,nvarid) #endif ierr = NF_PUT_ATT_TEXT (nid,nvarid,"title", 33, . "Ecart de la SST (pour slab-ocean)") ierr = NF_ENDDEF(nid) #ifdef NC_DOUBLE ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,deltat) #else ierr = NF_PUT_VAR_REAL (nid,nvarid,deltat) #endif c ierr = NF_REDEF (nid) #ifdef NC_DOUBLE ierr = NF_DEF_VAR (nid, "RUGMER", NF_DOUBLE, 1, idim2,nvarid) #else ierr = NF_DEF_VAR (nid, "RUGMER", NF_FLOAT, 1, idim2,nvarid) #endif ierr = NF_PUT_ATT_TEXT (nid,nvarid,"title", 28, . "Longueur de rugosite sur mer") ierr = NF_ENDDEF(nid) #ifdef NC_DOUBLE ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,rugmer) #else ierr = NF_PUT_VAR_REAL (nid,nvarid,rugmer) #endif c ierr = NF_REDEF (nid) #ifdef NC_DOUBLE ierr = NF_DEF_VAR (nid, "AGESNO", NF_DOUBLE, 1, idim2,nvarid) #else ierr = NF_DEF_VAR (nid, "AGESNO", NF_FLOAT, 1, idim2,nvarid) #endif ierr = NF_PUT_ATT_TEXT (nid,nvarid,"title", 15, . "Age de la neige") ierr = NF_ENDDEF(nid) #ifdef NC_DOUBLE ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,agesno) #else ierr = NF_PUT_VAR_REAL (nid,nvarid,agesno) #endif c CALL gr_dyn_fi(1, iip1, jjp1, klon, zmea, champhys) ierr = NF_REDEF (nid) #ifdef NC_DOUBLE ierr = NF_DEF_VAR (nid, "ZMEA", NF_DOUBLE, 1, idim2,nvarid) #else ierr = NF_DEF_VAR (nid, "ZMEA", NF_FLOAT, 1, idim2,nvarid) #endif ierr = NF_ENDDEF(nid) #ifdef NC_DOUBLE ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,champhys) #else ierr = NF_PUT_VAR_REAL (nid,nvarid,champhys) #endif c CALL gr_dyn_fi(1, iip1, jjp1, klon, zstd, champhys) ierr = NF_REDEF (nid) #ifdef NC_DOUBLE ierr = NF_DEF_VAR (nid, "ZSTD", NF_DOUBLE, 1, idim2,nvarid) #else ierr = NF_DEF_VAR (nid, "ZSTD", NF_FLOAT, 1, idim2,nvarid) #endif ierr = NF_ENDDEF(nid) #ifdef NC_DOUBLE ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,champhys) #else ierr = NF_PUT_VAR_REAL (nid,nvarid,champhys) #endif CALL gr_dyn_fi(1, iip1, jjp1, klon, zsig, champhys) ierr = NF_REDEF (nid) #ifdef NC_DOUBLE ierr = NF_DEF_VAR (nid, "ZSIG", NF_DOUBLE, 1, idim2,nvarid) #else ierr = NF_DEF_VAR (nid, "ZSIG", NF_FLOAT, 1, idim2,nvarid) #endif ierr = NF_ENDDEF(nid) #ifdef NC_DOUBLE ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,champhys) #else ierr = NF_PUT_VAR_REAL (nid,nvarid,champhys) #endif CALL gr_dyn_fi(1, iip1, jjp1, klon, zgam, champhys) ierr = NF_REDEF (nid) #ifdef NC_DOUBLE ierr = NF_DEF_VAR (nid, "ZGAM", NF_DOUBLE, 1, idim2,nvarid) #else ierr = NF_DEF_VAR (nid, "ZGAM", NF_FLOAT, 1, idim2,nvarid) #endif ierr = NF_ENDDEF(nid) #ifdef NC_DOUBLE ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,champhys) #else ierr = NF_PUT_VAR_REAL (nid,nvarid,champhys) #endif CALL gr_dyn_fi(1, iip1, jjp1, klon, zthe, champhys) ierr = NF_REDEF (nid) #ifdef NC_DOUBLE ierr = NF_DEF_VAR (nid, "ZTHE", NF_DOUBLE, 1, idim2,nvarid) #else ierr = NF_DEF_VAR (nid, "ZTHE", NF_FLOAT, 1, idim2,nvarid) #endif ierr = NF_ENDDEF(nid) #ifdef NC_DOUBLE ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,champhys) #else ierr = NF_PUT_VAR_REAL (nid,nvarid,champhys) #endif CALL gr_dyn_fi(1, iip1, jjp1, klon, zpic, champhys) ierr = NF_REDEF (nid) #ifdef NC_DOUBLE ierr = NF_DEF_VAR (nid, "ZPIC", NF_DOUBLE, 1, idim2,nvarid) #else ierr = NF_DEF_VAR (nid, "ZPIC", NF_FLOAT, 1, idim2,nvarid) #endif ierr = NF_ENDDEF(nid) #ifdef NC_DOUBLE ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,champhys) #else ierr = NF_PUT_VAR_REAL (nid,nvarid,champhys) #endif CALL gr_dyn_fi(1, iip1, jjp1, klon, zval, champhys) ierr = NF_REDEF (nid) #ifdef NC_DOUBLE ierr = NF_DEF_VAR (nid, "ZVAL", NF_DOUBLE, 1, idim2,nvarid) #else ierr = NF_DEF_VAR (nid, "ZVAL", NF_FLOAT, 1, idim2,nvarid) #endif ierr = NF_ENDDEF(nid) #ifdef NC_DOUBLE ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,champhys) #else ierr = NF_PUT_VAR_REAL (nid,nvarid,champhys) #endif CALL gr_dyn_fi(1, iip1, jjp1, klon, rugsrel, champhys) ierr = NF_REDEF (nid) #ifdef NC_DOUBLE ierr = NF_DEF_VAR (nid, "RUGSREL", NF_DOUBLE, 1, idim2,nvarid) #else ierr = NF_DEF_VAR (nid, "RUGSREL", NF_FLOAT, 1, idim2,nvarid) #endif ierr = NF_ENDDEF(nid) #ifdef NC_DOUBLE ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,champhys) #else ierr = NF_PUT_VAR_REAL (nid,nvarid,champhys) #endif c ierr = NF_CLOSE(nid) RETURN END