Changeset 72


Ignore:
Timestamp:
Feb 19, 2011, 5:36:31 PM (14 years ago)
Author:
aslmd
Message:

LMD_MM_MARS: corrections pour runs cycle de l'eau. inclusion des traceurs de
surface [manquement grave au modele precedent] et importation depuis les runs
GCM. attention water ice est q(:,nqmx-1) mais surface water ice est
qsurf(:,nqmx).
NB: il reste a impacter ces changements pour le cas NEWPHYS

M 71 SRC/WRFV2/Registry/Registry.EM
M 71 SRC/WRFV2/dyn_em/module_initialize_real.F
M 71 SRC/WRFV2/dyn_em/solve_em.F
M 71 SRC/WRFV2/dyn_em/module_initialize_quarter_ss.F
M 71 SRC/WRFV2/phys/module_lmd_driver.F
M 71 SRC/WRFV2/mars_lmd/libf/phymars/meso_physiq.F
Modifies pour initialiser, calculer et sortir qsurf dans le cas mars=2
[cycle de l'eau avec deux traceurs vapour et ice]

M 71 SRC/PREP_MARS/readmeteo.F90
M 71 SRC/WPS/wps_mars/metgrid/METGRID.TBL.ARW_MarsBase
Routines d'initialisation modifiees pour qsurf.

D 71 SRC/PREP_MARS/readmeteo_newphys.F90
D 71 SRC/PREP_MARS/readmeteo.F90_backup
M 71 SRC/PREP_MARS/readmeteo.F90
A + - SRC/PREP_MARS/obsolete/readmeteo_newphys.F90
A + - SRC/PREP_MARS/obsolete/readmeteo.F90_backup
M 71 SRC/WPS/wps_mars/metgrid/METGRID.TBL.ARW_MarsBase_newphys
M 71 SRC/WPS/wps_mars/switch_WPS_Mars
Desormais les programmes "readmeteo" et "metgrid" fonctionnent
indifferemment de la physique LMD utilisee (ancienne ou nouvelle)
--> une seule version de reference
--> retrocompatible pour l'ancienne physique

(les parametres inconnus sont regles a des valeurs "dummy" et ne sont pas utilisees)

A 0 SIMU/deftank/dust
Ajout mineur de fichiers parametres mais qui sera utile pour le cycle de poussiere

Location:
trunk/mesoscale
Files:
4 added
11 edited
2 moved

Legend:

Unmodified
Added
Removed
  • trunk/mesoscale/LMD_MM_MARS/SRC/PREP_MARS/readmeteo.F90

    r69 r72  
    2121!               12/2007 : include co2ice and emissivity                  !
    2222!               02/2008 : include water vapor and ice                    !
     23!               01/2010 : possible use of diagsoil for new physics       !
     24!               02/2011 : add dust tracers, correct surface              !
    2325!                                                                        !
    2426! spiga@lmd.jussieu.fr                                                   !     
     
    7173
    7274!! Intermediate data arrays
    73 integer :: k,l
    74 real, dimension(:), allocatable :: lat,lon,time,alt,aps,bps,levels
     75integer :: k,l,m,n,p
     76real, dimension(:), allocatable :: lat,lon,time,alt,aps,bps,levels,dsoilvert
    7577real, dimension(:,:), allocatable :: vide,ones,ghtsfile
    7678real, dimension(:,:), allocatable :: interm
     
    8183real, dimension(:,:,:,:), allocatable :: tfile,ufile,vfile,rfile,hfile
    8284real, dimension(:,:,:,:), allocatable :: eta_gcm
    83 real, dimension(:,:,:,:), allocatable :: tfileorig,ufileorig,vfileorig
    84 real, dimension(:,:,:,:), allocatable :: tsoilfile
     85!real, dimension(:,:,:,:), allocatable :: tfileorig,ufileorig,vfileorig
     86real, dimension(:,:,:,:), allocatable :: tsoilfile, dsoilfile, isoilfile
    8587real, dimension(:,:,:,:), allocatable :: waterfile, watericefile
    86 real, dimension(:,:,:), allocatable :: swaterfile, swatericefile
     88real, dimension(:,:,:), allocatable :: swatericefile!, swaterfile
     89real, dimension(:,:,:,:), allocatable :: dustfile,dustnfile
    8790
    8891!! Reading the parameter file
     
    202205allocate(tfile(lonlen,latlen,altlen,timelen))
    203206allocate(tsoilfile(lonlen,latlen,altlen,timelen))
    204 allocate(tfileorig(lonlen,latlen,altlen,timelen))
     207allocate(dsoilfile(lonlen,latlen,altlen,timelen))
     208allocate(isoilfile(lonlen,latlen,altlen,timelen))
     209allocate(dsoilvert(altlen))
     210!allocate(tfileorig(lonlen,latlen,altlen,timelen))
    205211allocate(ufile(lonlen,latlen,altlen,timelen))
    206 allocate(ufileorig(lonlen,latlen,altlen,timelen))
     212!allocate(ufileorig(lonlen,latlen,altlen,timelen))
    207213allocate(vfile(lonlen,latlen,altlen,timelen))
    208 allocate(vfileorig(lonlen,latlen,altlen,timelen))
     214!allocate(vfileorig(lonlen,latlen,altlen,timelen))
    209215allocate(rfile(lonlen,latlen,altlen,timelen))
    210216allocate(hfile(lonlen,latlen,altlen,timelen)) 
    211217allocate(waterfile(lonlen,latlen,altlen,timelen))
    212218allocate(watericefile(lonlen,latlen,altlen,timelen))
    213 allocate(swaterfile(lonlen,latlen,timelen))
     219!allocate(swaterfile(lonlen,latlen,timelen))
    214220allocate(swatericefile(lonlen,latlen,timelen))
     221allocate(dustfile(lonlen,latlen,altlen,timelen))
     222allocate(dustnfile(lonlen,latlen,altlen,timelen))
    215223allocate(psfile(lonlen,latlen,timelen))
    216224allocate(tsfile(lonlen,latlen,timelen))
     
    230238tfile(:,:,:,:)=0
    231239tsoilfile(:,:,:,:)=0
    232 tfileorig(:,:,:,:)=0
    233 ufileorig(:,:,:,:)=0
    234 vfileorig(:,:,:,:)=0
     240isoilfile(:,:,:,:)=0
     241dsoilfile(:,:,:,:)=0
     242dsoilvert(:)=0.
     243!tfileorig(:,:,:,:)=0
     244!ufileorig(:,:,:,:)=0
     245!vfileorig(:,:,:,:)=0
    235246ufile(:,:,:,:)=0
    236247vfile(:,:,:,:)=0
     
    239250waterfile(:,:,:,:)=0
    240251watericefile(:,:,:,:)=0
    241 swaterfile(:,:,:)=0
     252!swaterfile(:,:,:)=0
    242253swatericefile(:,:,:)=0
     254dustfile(:,:,:,:)=0
     255dustnfile(:,:,:,:)=0
    243256psfile(:,:,:)=0
    244257tsfile(:,:,:)=0
     
    366379   ierr = NF_INQ_VARID (nid,"emis",nvarid)
    367380IF (ierr .NE. NF_NOERR) THEN
    368         PRINT *, '...warning: not found in diagfi !'
     381        PRINT *, '...warning: not found in diagfi !'
    369382        PRINT *, '...will be filled with a prescribed value', emiss_prescribed
    370         emissfile(:,:,:)=emiss_prescribed       
     383  emissfile(:,:,:)=emiss_prescribed
    371384ELSE
    372385#ifdef NC_DOUBLE
    373         ierr = NF_GET_VAR_DOUBLE(nid, nvarid, emissfile)
     386  ierr = NF_GET_VAR_DOUBLE(nid, nvarid, emissfile)
    374387#else
    375         ierr = NF_GET_VAR_REAL(nid, nvarid, emissfile)
     388  ierr = NF_GET_VAR_REAL(nid, nvarid, emissfile)
    376389#endif
    377390ENDIF   
     
    380393   ierr = NF_INQ_VARID (nid,"co2ice",nvarid)
    381394IF (ierr .NE. NF_NOERR) THEN
    382         PRINT *, '...warning: not found in diagfi !'
    383         PRINT *, '...will be filled with a prescribed value', co2ice_prescribed
    384         co2icefile(:,:,:)=co2ice_prescribed     
     395  PRINT *, '...warning: not found in diagfi !'
     396  PRINT *, '...will be filled with a prescribed value', co2ice_prescribed
     397  co2icefile(:,:,:)=co2ice_prescribed
    385398ELSE
    386399#ifdef NC_DOUBLE
    387         ierr = NF_GET_VAR_DOUBLE(nid, nvarid, co2icefile)
     400  ierr = NF_GET_VAR_DOUBLE(nid, nvarid, co2icefile)
    388401#else
    389         ierr = NF_GET_VAR_REAL(nid, nvarid, co2icefile)
     402  ierr = NF_GET_VAR_REAL(nid, nvarid, co2icefile)
    390403#endif
    391404ENDIF
     
    418431
    419432
    420 !!"atmospheric" surface temperature is taken
    421 !!from original diagfi.nc first level
    422 !!... level is ~3-5 meters
    423 print *,'Near-Surface Temperature'
    424    ierr = NF_INQ_VARID (nid,"temp",nvarid)
    425    IF (ierr .NE. NF_NOERR) THEN
    426       ierr = NF_INQ_VARID (nid,"t",nvarid)
    427         IF (ierr .NE. NF_NOERR) THEN
    428            PRINT *, "Error: Readmeteo <temp> not found"
    429            stop
    430         ENDIF
    431    ENDIF
    432 #ifdef NC_DOUBLE
    433    ierr = NF_GET_VAR_DOUBLE(nid, nvarid, tfileorig)
    434 #else
    435    ierr = NF_GET_VAR_REAL(nid, nvarid, tfileorig)
    436 #endif
    437    tnsfile=tfileorig(:,:,1,:)
    438 
    439 !!"atmospheric" surface u is taken
    440 !!from original diagfi.nc first level
    441 !!... level is ~3-5 meters
    442 print *,'Near-Surface Zonal Wind'
    443    ierr = NF_INQ_VARID (nid,"u",nvarid)
    444    IF (ierr .NE. NF_NOERR) THEN
    445      PRINT *, "Error: Readmeteo <u> not found"
    446      stop
    447    ENDIF
    448 #ifdef NC_DOUBLE
    449    ierr = NF_GET_VAR_DOUBLE(nid, nvarid, ufileorig)
    450 #else
    451    ierr = NF_GET_VAR_REAL(nid, nvarid, ufileorig)
    452 #endif
    453    unsfile=ufileorig(:,:,1,:)
    454 
    455 !!"atmospheric" surface v is taken
    456 !!from original diagfi.nc first level
    457 !!... level is ~3-5 meters
    458 print *,'Near-Surface Meridional Wind'
    459    ierr = NF_INQ_VARID (nid,"v",nvarid)
    460    IF (ierr .NE. NF_NOERR) THEN
    461      PRINT *, "Error: Readmeteo <v> not found"
    462      stop
    463    ENDIF
    464 #ifdef NC_DOUBLE
    465    ierr = NF_GET_VAR_DOUBLE(nid, nvarid, vfileorig)
    466 #else
    467    ierr = NF_GET_VAR_REAL(nid, nvarid, vfileorig)
    468 #endif
    469    vnsfile=vfileorig(:,:,1,:)
     433!!!"atmospheric" surface temperature is taken
     434!!!from original diagfi.nc first level
     435!!!... level is ~3-5 meters
     436!print *,'Near-Surface Temperature'
     437!   ierr = NF_INQ_VARID (nid,"temp",nvarid)
     438!   IF (ierr .NE. NF_NOERR) THEN
     439!      ierr = NF_INQ_VARID (nid,"t",nvarid)
     440!       IF (ierr .NE. NF_NOERR) THEN
     441!           PRINT *, "Error: Readmeteo <temp> not found"
     442!           stop
     443!       ENDIF
     444!   ENDIF
     445!#ifdef NC_DOUBLE
     446!   ierr = NF_GET_VAR_DOUBLE(nid, nvarid, tfileorig)
     447!#else
     448!   ierr = NF_GET_VAR_REAL(nid, nvarid, tfileorig)
     449!#endif
     450!   tnsfile=tfileorig(:,:,1,:)
     451
     452!!!"atmospheric" surface u is taken
     453!!!from original diagfi.nc first level
     454!!!... level is ~3-5 meters
     455!print *,'Near-Surface Zonal Wind'
     456!   ierr = NF_INQ_VARID (nid,"u",nvarid)
     457!   IF (ierr .NE. NF_NOERR) THEN
     458!     PRINT *, "Error: Readmeteo <u> not found"
     459!     stop
     460!   ENDIF
     461!#ifdef NC_DOUBLE
     462!   ierr = NF_GET_VAR_DOUBLE(nid, nvarid, ufileorig)
     463!#else
     464!   ierr = NF_GET_VAR_REAL(nid, nvarid, ufileorig)
     465!#endif
     466!   unsfile=ufileorig(:,:,1,:)
     467
     468!!!"atmospheric" surface v is taken
     469!!!from original diagfi.nc first level
     470!!!... level is ~3-5 meters
     471!print *,'Near-Surface Meridional Wind'
     472!   ierr = NF_INQ_VARID (nid,"v",nvarid)
     473!   IF (ierr .NE. NF_NOERR) THEN
     474!     PRINT *, "Error: Readmeteo <v> not found"
     475!     stop
     476!   ENDIF
     477!#ifdef NC_DOUBLE
     478!   ierr = NF_GET_VAR_DOUBLE(nid, nvarid, vfileorig)
     479!#else
     480!   ierr = NF_GET_VAR_REAL(nid, nvarid, vfileorig)
     481!#endif
     482!   vnsfile=vfileorig(:,:,1,:)
    470483
    471484SELECT CASE(ident)
     
    520533   ierr = NF_GET_VAR_REAL(nid, nvarid, tfile)
    521534#endif
     535tnsfile=tfile(:,:,1,:)
    522536
    523537print *,'Zonal wind'   
     
    532546   ierr = NF_GET_VAR_REAL(nid, nvarid, ufile)
    533547#endif
     548unsfile=ufile(:,:,1,:)
    534549
    535550print *,'Meridional wind'
     
    544559   ierr = NF_GET_VAR_REAL(nid, nvarid, vfile)
    545560#endif
     561vnsfile=ufile(:,:,1,:)
    546562
    547563
     
    554570      write(*,*) "...No q02 - Water vapor set to 0"
    555571      waterfile(:,:,:,:)=0. 
    556     endif
    557     ierr=NF_GET_VAR_REAL(nid,nvarid,waterfile)
     572    else
     573      ierr=NF_GET_VAR_REAL(nid,nvarid,waterfile)
     574    endif   
    558575
    559576    print *,'Water ice'
     
    562579      write(*,*) "...No q01 - Water ice set to 0" 
    563580      watericefile(:,:,:,:)=0.
     581    else
     582      ierr=NF_GET_VAR_REAL(nid,nvarid,watericefile)
    564583    endif
    565     ierr=NF_GET_VAR_REAL(nid,nvarid,watericefile)
    566 
    567     print *,'Surface Water vapor'
    568     ierr=NF_INQ_VARID(nid,"qsurf02",nvarid)
    569     if (ierr.ne.NF_NOERR) then
    570       write(*,*) "...No qsurf02 - surface Water vapor set to 0"
    571       swaterfile(:,:,:)=0.
    572     endif
    573     ierr=NF_GET_VAR_REAL(nid,nvarid,swaterfile)
     584!    print *,'Surface Water vapor'
     585!    ierr=NF_INQ_VARID(nid,"qsurf02",nvarid)
     586!    if (ierr.ne.NF_NOERR) then
     587!      write(*,*) "...No qsurf02 - surface Water vapor set to 0"
     588!      swaterfile(:,:,:)=0.
     589!    endif
     590!    ierr=NF_GET_VAR_REAL(nid,nvarid,swaterfile)
    574591
    575592    print *,'Surface Water ice'
     
    578595      write(*,*) "...No qsurf01 - surface Water ice set to 0"
    579596      swatericefile(:,:,:)=0.
     597    else
     598      ierr=NF_GET_VAR_REAL(nid,nvarid,swatericefile)
    580599    endif
    581     ierr=NF_GET_VAR_REAL(nid,nvarid,swatericefile)
    582600!!------------------------
    583601!! special water stuff
     602!!------------------------
     603
     604!!------------------------
     605!! special dust stuff
     606!!------------------------
     607    print *,'Dust mass'
     608    ierr=NF_INQ_VARID(nid,"dustq",nvarid)
     609    if (ierr.ne.NF_NOERR) then
     610      write(*,*) "...No dustq - Dust mass set to 0"
     611      dustfile(:,:,:,:)=0.
     612    else
     613      ierr=NF_GET_VAR_REAL(nid,nvarid,dustfile)
     614    endif
     615
     616    print *,'Dust number'
     617    ierr=NF_INQ_VARID(nid,"dustN",nvarid)
     618    if (ierr.ne.NF_NOERR) then
     619      write(*,*) "...No dustN - Dust number set to 0"
     620      dustnfile(:,:,:,:)=0.
     621    else
     622      ierr=NF_GET_VAR_REAL(nid,nvarid,dustnfile)
     623    endif
     624!!------------------------
     625!! special dust stuff
    584626!!------------------------
    585627
     
    595637                tsoilfile(:,:,l,:)=tsfile(:,:,:)
    596638        ENDDO
     639    else
     640        ierr=NF_GET_VAR_REAL(nid,nvarid,tsoilfile)
    597641    endif
    598     ierr=NF_GET_VAR_REAL(nid,nvarid,tsoilfile)
     642
     643!!!!!!!!
     644!!!!!!!! new physics (but still compatible with old physics)
     645    print *,'Soil depths'
     646    ierr=NF_INQ_VARID(nid,"soildepth",nvarid)
     647    if (ierr.ne.NF_NOERR) then
     648        write(*,*) "...No soildepth - Set to -999"  !!! see soil_settings in LMD physics
     649        DO l=1,altlen
     650                dsoilvert(l)=-999.
     651        ENDDO
     652    else
     653        ierr=NF_GET_VAR_REAL(nid,nvarid,dsoilvert)
     654    endif
     655    print *, 'wait a minute' !! AS: I know this could be better
     656    DO m=1,lonlen
     657     DO n=1,latlen
     658      DO p=1,timelen
     659       dsoilfile(m,n,:,p) = dsoilvert(:)
     660      ENDDO
     661     ENDDO
     662    ENDDO
     663    DEALLOCATE(vertdsoil)
     664
     665    print *,'Soil thermal inertia'
     666    ierr=NF_INQ_VARID(nid,"inertiedat",nvarid)
     667    if (ierr.ne.NF_NOERR) then
     668        write(*,*) "...No soil therm. inert. - Set to -999"
     669        DO l=1,altlen
     670                isoilfile(:,:,l,:)=-999.
     671        ENDDO
     672    else
     673        ierr=NF_GET_VAR_REAL(nid,nvarid,isoilfile)
     674    endif
     675!!!!!!!!
     676!!!!!!!! new physics
    599677
    600678
     
    625703ENDIF
    626704
    627 
    628705!!-----------------------------
    629706!! Loop on the written files
     
    666743!! 1. Surface data
    667744!!---------------------------------------------
     745!!
     746!! a mettre pour tous sinon
     747!!     WRF_DEBUG: Warning DIM             4 , NAME num_metgrid_levels REDIFINED  by
     748!!            var DUSTN            26           25  in wrf_io.F90 line         2349
     749!!
    668750
    669751!
     
    701783DESC='Atmospheric temperature'
    702784XLVL=200100.
    703 !SLAB=tsfile(:,:,time_out(l))
    704 !SLAB=tfileorig(:,:,1,time_out(l))
    705785SLAB=tnsfile(:,:,time_out(l))
    706786        ! And now put everything in the destination file
     
    721801DESC='Zonal wind'
    722802XLVL=200100.
    723 !SLAB=ufile(:,:,1,time_out(l))
    724 !SLAB=ufileorig(:,:,1,time_out(l))
    725803SLAB=unsfile(:,:,time_out(l))
    726804        ! And now put everything in the destination file
     
    741819DESC='Meridional wind'
    742820XLVL=200100.
    743 !SLAB=vfile(:,:,1,time_out(l))
    744 !SLAB=vfileorig(:,:,1,time_out(l))
    745821SLAB=vnsfile(:,:,time_out(l))
    746822        ! And now put everything in the destination file
     
    761837DESC='Customized 2D static field'
    762838XLVL=200100.
    763 !SLAB=co2icefile(:,:,time_out(l))
    764839SLAB=vide(:,:)
    765 !SLAB=vide(:,:)+ptop
    766840        ! And now put everything in the destination file
    767841        ! ... Header
     
    853927DESC='ZMEA'
    854928XLVL=200100.
    855 !SLAB=vide(:,:)
    856929SLAB=gwparam(:,:,1)
    857930        ! And now put everything in the destination file
     
    872945DESC='ZSTD'
    873946XLVL=200100.
    874 !SLAB=vide(:,:)
    875947SLAB=gwparam(:,:,2)
    876948        ! And now put everything in the destination file
     
    909981DESC='Ground temperature'
    910982XLVL=200100.
    911 !SLAB=vide(:,:)
    912983SLAB=tsfile(:,:,time_out(l))
    913984        ! And now put everything in the destination file
     
    928999DESC='ZSIG'
    9291000XLVL=200100.
    930 !SLAB=vide(:,:)
    9311001SLAB=gwparam(:,:,3)
    9321002        ! And now put everything in the destination file
     
    9471017DESC='ZGAM'
    9481018XLVL=200100.
    949 !SLAB=vide(:,:)
    9501019SLAB=gwparam(:,:,4)
    9511020        ! And now put everything in the destination file
     
    9661035DESC='ZTHE'
    9671036XLVL=200100.
    968 !SLAB=vide(:,:)
    9691037SLAB=gwparam(:,:,5)
    9701038        ! And now put everything in the destination file
     
    9821050!------------------------!
    9831051FIELD='SM100200'
    984 UNITS='fraction'
    985 DESC='Relative humidity'
    986 XLVL=200100.
    987 SLAB=vide(:,:)
     1052UNITS='kg/kg'
     1053DESC='Surf water ice'
     1054XLVL=200100.
     1055SLAB=swatericefile(:,:,time_out(l))
    9881056        ! And now put everything in the destination file
    9891057        ! ... Header
     
    10041072DESC='Water vapor'
    10051073XLVL=200100.
    1006 !SLAB=waterfile(:,:,1,time_out(l))
    1007 SLAB=swaterfile(:,:,time_out(l))
     1074SLAB=waterfile(:,:,1,time_out(l))
    10081075        ! And now put everything in the destination file
    10091076        ! ... Header
     
    10231090DESC='Water ice'
    10241091XLVL=200100.
    1025 !SLAB=watericefile(:,:,1,time_out(l))
    1026 SLAB=swatericefile(:,:,time_out(l))
     1092SLAB=watericefile(:,:,1,time_out(l))
    10271093        ! And now put everything in the destination file
    10281094        ! ... Header
     
    10521118!print *,'The field '//DESC//' was written to '//output
    10531119
     1120!------------------------!
     1121! >>> Write a variable   !
     1122!    ... Copy&Paste part !
     1123!------------------------!
     1124FIELD='DSOIL'
     1125UNITS='m'
     1126DESC='Soil depths'
     1127XLVL=200100.
     1128SLAB=dsoilfile(:,:,1,time_out(l))
     1129        ! And now put everything in the destination file
     1130        ! ... Header
     1131        write(1) IFV
     1132        write(1) HDATE,XFCST,SOURCE,FIELD,UNITS,DESC,XLVL,NX,NY,IPROJ
     1133        write(1) STARTLOC,STARTLAT,STARTLON,DELTALAT,DELTALON
     1134        ! ... Data
     1135        write(1) SLAB
     1136!print *,'The field '//DESC//' was written to '//output
     1137
     1138!------------------------!
     1139! >>> Write a variable   !
     1140!    ... Copy&Paste part !
     1141!------------------------!
     1142FIELD='ISOIL'
     1143UNITS='tiu'
     1144DESC='Soil thermal inertia'
     1145XLVL=200100.
     1146SLAB=isoilfile(:,:,1,time_out(l))
     1147        ! And now put everything in the destination file
     1148        ! ... Header
     1149        write(1) IFV
     1150        write(1) HDATE,XFCST,SOURCE,FIELD,UNITS,DESC,XLVL,NX,NY,IPROJ
     1151        write(1) STARTLOC,STARTLAT,STARTLON,DELTALAT,DELTALON
     1152        ! ... Data
     1153        write(1) SLAB
     1154!print *,'The field '//DESC//' was written to '//output
     1155
     1156!------------------------!
     1157! >>> Write a variable   !
     1158!    ... Copy&Paste part !
     1159!------------------------!
     1160FIELD='DUSTQ'
     1161UNITS='kg/kg'
     1162DESC='Dust mixing ratio'
     1163XLVL=200100.
     1164SLAB=dustfile(:,:,1,time_out(l))
     1165        ! And now put everything in the destination file
     1166        ! ... Header
     1167        write(1) IFV
     1168        write(1) HDATE,XFCST,SOURCE,FIELD,UNITS,DESC,XLVL,NX,NY,IPROJ
     1169        write(1) STARTLOC,STARTLAT,STARTLON,DELTALAT,DELTALON
     1170        ! ... Data
     1171        write(1) SLAB
     1172!print *,'The field '//DESC//' was written to '//output
     1173
     1174!------------------------!
     1175! >>> Write a variable   !
     1176!    ... Copy&Paste part !
     1177!------------------------!
     1178FIELD='DUSTN'
     1179UNITS='part/kg'
     1180DESC='Dust number density'
     1181XLVL=200100.
     1182SLAB=dustnfile(:,:,1,time_out(l))
     1183        ! And now put everything in the destination file
     1184        ! ... Header
     1185        write(1) IFV
     1186        write(1) HDATE,XFCST,SOURCE,FIELD,UNITS,DESC,XLVL,NX,NY,IPROJ
     1187        write(1) STARTLOC,STARTLAT,STARTLON,DELTALAT,DELTALON
     1188        ! ... Data
     1189        write(1) SLAB
     1190!print *,'The field '//DESC//' was written to '//output
    10541191
    10551192
     
    12371374!print *,'The field '//DESC//' was written to '//output
    12381375
     1376!------------------------!
     1377! >>> Write a variable   !
     1378!    ... Copy&Paste part !
     1379!------------------------!
     1380FIELD='DSOIL'
     1381UNITS='m'
     1382DESC='Soil depths'
     1383DO k = 1,altlen
     1384        XLVL=levels(k)
     1385        SLAB=dsoilfile(:,:,k,time_out(l))
     1386                ! And now put everything in the destination file
     1387                ! ... Header
     1388        write(1) IFV
     1389        write(1) HDATE,XFCST,SOURCE,FIELD,UNITS,DESC,XLVL,NX,NY,IPROJ
     1390        write(1) STARTLOC,STARTLAT,STARTLON,DELTALAT,DELTALON
     1391                ! ... Data
     1392                write(1) SLAB
     1393END DO
     1394!print *,'The field '//DESC//' was written to '//output
     1395
     1396!------------------------!
     1397! >>> Write a variable   !
     1398!    ... Copy&Paste part !
     1399!------------------------!
     1400FIELD='ISOIL'
     1401UNITS='tiu'
     1402DESC='Soil thermal inertia'
     1403DO k = 1,altlen
     1404        XLVL=levels(k)
     1405        SLAB=isoilfile(:,:,k,time_out(l))
     1406                ! And now put everything in the destination file
     1407                ! ... Header
     1408        write(1) IFV
     1409        write(1) HDATE,XFCST,SOURCE,FIELD,UNITS,DESC,XLVL,NX,NY,IPROJ
     1410        write(1) STARTLOC,STARTLAT,STARTLON,DELTALAT,DELTALON
     1411                ! ... Data
     1412                write(1) SLAB
     1413END DO
     1414!print *,'The field '//DESC//' was written to '//output
     1415
     1416!------------------------!
     1417! >>> Write a variable   !
     1418!    ... Copy&Paste part !
     1419!------------------------!
     1420FIELD='DUSTQ'
     1421UNITS='kg/kg'
     1422DESC='Dust mixing ratio'
     1423DO k = 1,altlen
     1424        XLVL=levels(k)
     1425        SLAB=dustfile(:,:,k,time_out(l))
     1426                ! And now put everything in the destination file
     1427                ! ... Header
     1428        write(1) IFV
     1429        write(1) HDATE,XFCST,SOURCE,FIELD,UNITS,DESC,XLVL,NX,NY,IPROJ
     1430        write(1) STARTLOC,STARTLAT,STARTLON,DELTALAT,DELTALON
     1431                ! ... Data
     1432                write(1) SLAB
     1433END DO
     1434!print *,'The field '//DESC//' was written to '//output
     1435
     1436!------------------------!
     1437! >>> Write a variable   !
     1438!    ... Copy&Paste part !
     1439!------------------------!
     1440FIELD='DUSTN'
     1441UNITS='part/kg'
     1442DESC='Dust number density'
     1443DO k = 1,altlen
     1444        XLVL=levels(k)
     1445        SLAB=dustnfile(:,:,k,time_out(l))
     1446                ! And now put everything in the destination file
     1447                ! ... Header
     1448        write(1) IFV
     1449        write(1) HDATE,XFCST,SOURCE,FIELD,UNITS,DESC,XLVL,NX,NY,IPROJ
     1450        write(1) STARTLOC,STARTLAT,STARTLON,DELTALAT,DELTALON
     1451                ! ... Data
     1452                write(1) SLAB
     1453END DO
     1454!print *,'The field '//DESC//' was written to '//output
    12391455
    12401456print *,'****done file '//output, int(100.*float(l)/float(FILES)), ' % '
     
    12521468deallocate(tfile)
    12531469deallocate(tsoilfile)
    1254 deallocate(tfileorig)
     1470deallocate(isoilfile)
     1471deallocate(dsoilfile)
     1472!deallocate(dsoilvert)
     1473!deallocate(tfileorig)
    12551474deallocate(ufile)
    1256 deallocate(ufileorig)
     1475!deallocate(ufileorig)
    12571476deallocate(vfile)
    1258 deallocate(vfileorig)
     1477!deallocate(vfileorig)
    12591478deallocate(rfile)
    12601479deallocate(hfile) 
    12611480deallocate(waterfile)
    12621481deallocate(watericefile)
    1263 deallocate(swaterfile)
     1482!deallocate(swaterfile)
    12641483deallocate(swatericefile)
     1484deallocate(dustfile)
     1485deallocate(dustnfile)
    12651486deallocate(psfile)
    12661487deallocate(tsfile)
  • trunk/mesoscale/LMD_MM_MARS/SRC/WPS/wps_mars/metgrid/METGRID.TBL.ARW_MarsBase

    r11 r72  
    192192        flag_in_output=FLAG_SM040100
    193193========================================
     194# WATER ICE ON THE SURFACE
    194195name=SM100200
    195196#        interp_option=sixteen_pt+four_pt+average_4pt+search
  • trunk/mesoscale/LMD_MM_MARS/SRC/WPS/wps_mars/metgrid/METGRID.TBL.ARW_MarsBase_newphys

    r55 r72  
    192192        flag_in_output=FLAG_SM040100
    193193========================================
     194# WATER ICE ON THE SURFACE
    194195name=SM100200
    195196#        interp_option=sixteen_pt+four_pt+average_4pt+search
  • trunk/mesoscale/LMD_MM_MARS/SRC/WPS/wps_mars/switch_WPS_Mars

    r14 r72  
    2323cd metgrid
    2424\rm METGRID.TBL 2> /dev/null
    25 cp ../wps_mars/metgrid/METGRID.TBL.ARW_MarsBase METGRID.TBL.ARW
     25#cp ../wps_mars/metgrid/METGRID.TBL.ARW_MarsBase METGRID.TBL.ARW
     26cp ../wps_mars/metgrid/METGRID.TBL.ARW_MarsBase_newphys METGRID.TBL.ARW
    2627cd src
    2728rm module_date_pack.f90
  • trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/Registry/Registry.EM

    r55 r72  
    8181####
    8282state  real  TSURF     ij   misc  1  -  rhd  "TSURF"     "SURF TEMPERATURE"                "K"       #SAVEMARS2 tsurf
    83 state  real  CO2ICE    ij   misc  1  -  rd   "CO2ICE"    "CO2 GROUND ICE"                  "kg"      #SAVEMARS2 co2ice
     83state  real  CO2ICE    ij   misc  1  -  rhd  "CO2ICE"    "CO2 GROUND ICE"                  "kg m-2"  #SAVEMARS2 co2ice
    8484state  real  EMISSIV   ij   misc  1  -  rd   "EMISSIV"   "EMISSIVITY"                      ""        #SAVEMARS2 emis
    8585state  real  THETA     ij   misc  1  -  rd   "THETA"     "SLOPE INCLINATION"               "deg"     #SAVEMARS2 theta_sl
     
    9090state  real  SWUP      ij   misc  1  -  rd   "SWUP"      "UPWARD SW FLUX AT TOP"           "W m-2"   #SAVEMARS2 fluxtop_sw_tot   
    9191state  real  LWUP      ij   misc  1  -  rd   "LWUP"      "UPWARD LW FLUX AT TOP"           "W m-2"   #SAVEMARS2 fluxtop_lw
    92 state  real  MTOT      ij   misc  1  -  rd   "MTOT"      "TOTAL MASS WATER VAPOR"          "kg m-2"  #SAVEMARS2 mtot
    93 state  real  ICETOT    ij   misc  1  -  rd   "ICETOT"    "TOTAL MASS WATER ICE"            "kg m-2"  #SAVEMARS2 icetot
    94 state  real  RAVE      ij   misc  1  -  rd   "RAVE"      "MEAN ICE RADIUS"                 "m"       #SAVEMARS2 rave
     92state  real  MTOT      ij   misc  1  -  rhd  "MTOT"      "TOTAL MASS WATER VAPOR"          "kg m-2"  #SAVEMARS2 mtot
     93state  real  ICETOT    ij   misc  1  -  rhd  "ICETOT"    "TOTAL MASS WATER ICE"            "kg m-2"  #SAVEMARS2 icetot
     94state  real  RAVE      ij   misc  1  -  rhd  "RAVE"      "MEAN ICE RADIUS"                 "m"       #SAVEMARS2 rave
    9595state  real  RICE      ikj  misc  1  -  rd   "RICE"      "ICE RADIUS"                      "m"       #SAVEMARS3 rice
    9696state  real  HR_SW     ikj  misc  1  -  rd   "HR_SW"     "HEATING RATE SW"                 "K/s"     #SAVEMARS3 zdtsw
    9797state  real  HR_LW     ikj  misc  1  -  rd   "HR_LW"     "HEATING RATE LW"                 "K/s"     #SAVEMARS3 zdtlw
    9898state  real  HR_SH     ikj  misc  1  -  rd   "HR_SH"     "HEATING RATE sens. heat"         "K/s"     #SAVEMARS3 zdtdif
     99state  real  QSURF     ij   misc  1  -  rhd  "QSURF"     "TRACER AT SURFACE"               "kg m-2"  #SAVEMARS2 qsurflast
    99100####
    100101####
     
    202203state  real   slpy            ij   misc  1  -  i012rd  "SLOPEY"      "slope y direction"       "rad"
    203204state  real   mars_emiss      ij   misc  1  -  i012rd  "MARS_EMISS"  "emissivity"              "0 - 1 fraction"
    204 state  real   mars_cice       ij   misc  1  -  i012rd  "MARS_CICE"   "co2 ice"                 "kg"
     205state  real   mars_cice       ij   misc  1  -  i012rd  "MARS_CICE"   "co2 ice"                 "kg/m2"
     206state  real   mars_wice       ij   misc  1  -  i012rd  "MARS_WICE"   "h2o ice"                 "kg/m2"
    205207state  real   mars_tsoil     ilj   misc  1  -  i012rd  "MARS_TSOIL"  "soil temperatures"       "K"
    206208state  real   mars_isoil     ilj   misc  1  -  i012rd  "MARS_ISOIL"  "soil thermal inertia"    "tiu"
  • trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/dyn_em/module_initialize_quarter_ss.F

    r11 r72  
    429429    grid%mars_emiss(i,j)=0.95
    430430    grid%mars_cice(i,j)=0.
     431    grid%mars_wice(i,j)=0.
    431432    grid%slpx(i,j) = 0.
    432433    grid%slpy(i,j) = 0.
  • trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/dyn_em/module_initialize_real.F

    r63 r72  
    277277              grid%mars_emiss(i,j)=grid%st000010(i,j)
    278278              grid%mars_cice(i,j)=grid%st010040(i,j)
     279              grid%mars_wice(i,j)=grid%sm100200(i,j)
    279280                  !! one more security ... co2ice cannot be negative
    280281                  IF (grid%mars_cice(i,j) .lt. 0.) grid%mars_cice(i,j)=0.
     282                  IF (grid%mars_wice(i,j) .lt. 0.) grid%mars_wice(i,j)=0.
    281283
    282284              DO k = 1, config_flags%num_soil_layers 
     
    484486grid%mars_emiss(i,j) = 0.95
    485487grid%mars_cice(i,j) = 0.
     488grid%mars_wice(i,j) = 0.
    486489grid%mars_tsoil(i,:,j)=grid%mars_tsoil(its+1,:,jts+1)
    487490
  • trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/dyn_em/solve_em.F

    r55 r72  
    853853     &        ,MARS_ALB=grid%albedo_gcm,MARS_TI=grid%therm_inert  &
    854854     &        ,MARS_CICE=grid%mars_cice,MARS_EMISS=grid%mars_emiss   & 
     855     &        ,MARS_WICE=grid%mars_wice         &
    855856     &        ,MARS_TSOIL=grid%mars_tsoil       &
    856857#ifdef NEWPHYS
  • trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd/libf/phymars/meso_physiq.F

    r54 r72  
    184184      REAL ust(ngridmx)    !! pour LES avec isfflx!=0
    185185      LOGICAL flag_LES     !! pour LES avec isfflx!=0
     186      REAL qsurflast(ngridmx) !! pour diagnostics
    186187c ****WRF
    187188      REAL pday
     
    14961497         wtsurf(ig) = tsurf(ig)    !! surface temperature
    14971498         wco2ice(ig) = co2ice(ig)  !! co2 ice
     1499
     1500         !!! TEMP TEMP TEMP TEMP TEMP TEMP TEMP
     1501         !!! specific to WRF WRF WRF
     1502         !!! just to output water ice on surface
     1503         !!! [it might not be water ice on surface but OK]
     1504         !!! uncomment the Registry entry
     1505         qsurflast(ig) = qsurf(ig,nqmx)
     1506
    14981507      enddo
    14991508c
  • trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/phys/module_lmd_driver.F

    r70 r72  
    3030        MARS_MODE, &
    3131        MARS_ALB,MARS_TI,MARS_CICE,MARS_EMISS, &
     32        MARS_WICE, &
    3233        MARS_TSOIL, &
    3334#ifdef NEWPHYS
     
    109110     XLAT,XLONG,HT,  &
    110111     MARS_ALB,MARS_TI,MARS_EMISS,MARS_CICE, &
     112     MARS_WICE, &
    111113     SLPX,SLPY
    112114! 3D arrays
     
    440442!ENDIF   
    441443
    442 print *, 'check dynamics'
    443   !!! in some cases, weird values are displayed
    444   !!! despite the fact that outputs are OK...
    445   !print *, 'u', MAXVAL(u), MINVAL(u)
    446   !print *, 'v', MAXVAL(v), MINVAL(v)
    447   !print *, 'w', MAXVAL(w), MINVAL(w)
    448   !print *, 't', MAXVAL(t), MINVAL(t, MASK = t > 0)
    449 print *, 'u', u(10,1,10), u(10,15,10)
    450 print *, 'v', v(10,1,10), v(10,15,10)
    451 print *, 'w', w(10,1,10), w(10,15,10)
    452 print *, 't', t(10,1,10), t(10,15,10)
     444!print *, 'check dynamics'
     445!  !!! in some cases, weird values are displayed
     446!  !!! despite the fact that outputs are OK...
     447!  !print *, 'u', MAXVAL(u), MINVAL(u)
     448!  !print *, 'v', MAXVAL(v), MINVAL(v)
     449!  !print *, 'w', MAXVAL(w), MINVAL(w)
     450!  !print *, 't', MAXVAL(t), MINVAL(t, MASK = t > 0)
     451!print *, 'u', u(10,1,10), u(10,15,10)
     452!print *, 'v', v(10,1,10), v(10,15,10)
     453!print *, 'w', w(10,1,10), w(10,15,10)
     454!print *, 't', t(10,1,10), t(10,15,10)
    453455
    454456!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
     
    786788
    787789!-------------------!
     790! Tracer at surface !
     791!-------------------!
     792#ifdef NEWPHYS
     793  !!! a faire !!!
     794  PRINT *, 'WARNING WARNING no tracer at surface'
     795  qsurf_val(:)=0.
     796#else
     797SELECT CASE (MARS_MODE)
     798    CASE(0)  !! NO TRACERS (mars=0)
     799    qsurf_val(:)=0.
     800    CASE(1)  !! WATER CYCLE (mars=1)
     801    qsurf_val(2)=MARS_WICE(i,j)    !! attention... H2O ice is tracer nqmx in qsurf in LMD physics
     802    qsurf_val(1)=0.               
     803    CASE(2)  !! DUST CYCLE (mars=2)
     804    qsurf_val(:)=0.
     805END SELECT
     806#endif
     807
     808!-------------------!
    788809! Slope inclination !
    789810!-------------------!
     
    832853PRINT *,'v_prof ',v_prof
    833854PRINT *,'tsoil ',tsoil_val
     855PRINT *,'qsurf ',qsurf_val
    834856#ifdef NEWPHYS
    835857PRINT *,'isoil ',isoil_val
     
    844866!-------------------------!
    845867!-------------------------!
    846 q2_val(:)=0      !PBL wind variance
    847 qsurf_val(:)=0   !Tracer on surface
     868q2_val(:)=0.      !PBL wind variance
    848869
    849870!-----------------!
     
    11671188!!PRINT *, 'min',MINVAL(RUBLTEN, MASK=RUBLTEN/=0.),&
    11681189!!        ' at',MINLOC(RUBLTEN, MASK=RUBLTEN/=0.)
    1169 PRINT *, RUBLTEN(10,1,10), RUBLTEN(10,15,10)
     1190!PRINT *, RUBLTEN(10,1,10), RUBLTEN(10,15,10)
    11701191PRINT *, 'v non-zero tendencies'
    11711192!!PRINT *, 'max',MAXVAL(RVBLTEN, MASK=RVBLTEN/=0.),&
     
    11731194!!PRINT *, 'min',MINVAL(RVBLTEN, MASK=RVBLTEN/=0.),&
    11741195!!        ' at',MINLOC(RVBLTEN, MASK=RVBLTEN/=0.)
    1175 PRINT *, RVBLTEN(10,1,10), RVBLTEN(10,15,10)
     1196!PRINT *, RVBLTEN(10,1,10), RVBLTEN(10,15,10)
    11761197!!! STOP IF CRASH
    11771198!IF (MAXVAL(RUBLTEN, MASK=RUBLTEN/=0.) == 0.) STOP
  • trunk/mesoscale/NOTES.txt

    r51 r72  
     1
     2- attention il faut les trois MARS sinon il s arrete sans message clair
     3- attention a ne pas lancer le modele s il est deja lance
     4
    15
    26ROUTINES a AJOUTER sont dans COMMON_GCM
Note: See TracChangeset for help on using the changeset viewer.