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/LMD_MM_MARS/SRC/PREP_MARS
Files:
1 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)
Note: See TracChangeset for help on using the changeset viewer.