Ignore:
Timestamp:
Mar 1, 2012, 12:57:47 AM (13 years ago)
Author:
aslmd
Message:

MESOSCALE: for improved watercycle runs: ccn_mass and ccn_number are now passed through boundaries.

File:
1 edited

Legend:

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

    r324 r549  
    8888real, dimension(:,:,:), allocatable :: swatericefile!, swaterfile
    8989real, dimension(:,:,:,:), allocatable :: dustfile,dustnfile
     90real, dimension(:,:,:,:), allocatable :: ccnfile,ccnnfile
    9091
    9192!! Reading the parameter file
     
    229230allocate(dustfile(lonlen,latlen,altlen,timelen))
    230231allocate(dustnfile(lonlen,latlen,altlen,timelen))
     232allocate(ccnfile(lonlen,latlen,altlen,timelen))
     233allocate(ccnnfile(lonlen,latlen,altlen,timelen))
    231234allocate(psfile(lonlen,latlen,timelen))
    232235allocate(tsfile(lonlen,latlen,timelen))
     
    282285dustfile(:,:,:,:)=0
    283286dustnfile(:,:,:,:)=0
     287ccnfile(:,:,:,:)=0
     288ccnnfile(:,:,:,:)=0
    284289psfile(:,:,:)=0
    285290tsfile(:,:,:)=0
     
    651656    else
    652657      ierr=NF_GET_VAR_REAL(nid,nvarid,dustnfile)
     658    endif
     659
     660    print *,'CCN mass'
     661    ierr=NF_INQ_VARID(nid,"ccn",nvarid)
     662    if (ierr.ne.NF_NOERR) then
     663      write(*,*) "...No ccn - CCN mass set to 0"
     664      dustfile(:,:,:,:)=0.
     665    else
     666      ierr=NF_GET_VAR_REAL(nid,nvarid,ccnfile)
     667    endif
     668
     669    print *,'CCN number'
     670    ierr=NF_INQ_VARID(nid,"ccnN",nvarid)
     671    if (ierr.ne.NF_NOERR) then
     672      write(*,*) "...No ccnN - CCN number set to 0"
     673      dustnfile(:,:,:,:)=0.
     674    else
     675      ierr=NF_GET_VAR_REAL(nid,nvarid,ccnnfile)
    653676    endif
    654677!!------------------------
     
    12411264!------------------------!
    12421265! >>> Write a variable   !
     1266!    ... Copy&Paste part !
     1267!------------------------!
     1268FIELD='CCNQ'
     1269UNITS='kg/kg'
     1270DESC='CCN mixing ratio'
     1271XLVL=200100.
     1272SLAB=ccnfile(:,:,1,time_out(l))
     1273        ! And now put everything in the destination file
     1274        ! ... Header
     1275        write(1) IFV
     1276        write(1) HDATE,XFCST,SOURCE,FIELD,UNITS,DESC,XLVL,NX,NY,IPROJ
     1277        write(1) STARTLOC,STARTLAT,STARTLON,DELTALAT,DELTALON
     1278        ! ... Data
     1279        write(1) SLAB
     1280!print *,'The field '//DESC//' was written to '//output
     1281
     1282!------------------------!
     1283! >>> Write a variable   !
     1284!    ... Copy&Paste part !
     1285!------------------------!
     1286FIELD='CCNN'
     1287UNITS='part/kg'
     1288DESC='CCN number density'
     1289XLVL=200100.
     1290SLAB=ccnnfile(:,:,1,time_out(l))
     1291        ! And now put everything in the destination file
     1292        ! ... Header
     1293        write(1) IFV
     1294        write(1) HDATE,XFCST,SOURCE,FIELD,UNITS,DESC,XLVL,NX,NY,IPROJ
     1295        write(1) STARTLOC,STARTLAT,STARTLON,DELTALAT,DELTALON
     1296        ! ... Data
     1297        write(1) SLAB
     1298!print *,'The field '//DESC//' was written to '//output
     1299
     1300
     1301!------------------------!
     1302! >>> Write a variable   !
    12431303!     PHOTOCHEMISTRY     !
    12441304!------------------------!
     
    15131573        XLVL=levels(k)
    15141574        SLAB=dustnfile(:,:,k,time_out(l))
     1575                ! And now put everything in the destination file
     1576                ! ... Header
     1577        write(1) IFV
     1578        write(1) HDATE,XFCST,SOURCE,FIELD,UNITS,DESC,XLVL,NX,NY,IPROJ
     1579        write(1) STARTLOC,STARTLAT,STARTLON,DELTALAT,DELTALON
     1580                ! ... Data
     1581                write(1) SLAB
     1582END DO
     1583!print *,'The field '//DESC//' was written to '//output
     1584
     1585!------------------------!
     1586! >>> Write a variable   !
     1587!    ... Copy&Paste part !
     1588!------------------------!
     1589FIELD='CCNQ'
     1590UNITS='kg/kg'
     1591DESC='CCN mixing ratio'
     1592DO k = 1,altlen
     1593        XLVL=levels(k)
     1594        SLAB=ccnfile(:,:,k,time_out(l))
     1595                ! And now put everything in the destination file
     1596                ! ... Header
     1597        write(1) IFV
     1598        write(1) HDATE,XFCST,SOURCE,FIELD,UNITS,DESC,XLVL,NX,NY,IPROJ
     1599        write(1) STARTLOC,STARTLAT,STARTLON,DELTALAT,DELTALON
     1600                ! ... Data
     1601                write(1) SLAB
     1602END DO
     1603!print *,'The field '//DESC//' was written to '//output
     1604
     1605!------------------------!
     1606! >>> Write a variable   !
     1607!    ... Copy&Paste part !
     1608!------------------------!
     1609FIELD='CCNN'
     1610UNITS='part/kg'
     1611DESC='CCN number density'
     1612DO k = 1,altlen
     1613        XLVL=levels(k)
     1614        SLAB=ccnnfile(:,:,k,time_out(l))
    15151615                ! And now put everything in the destination file
    15161616                ! ... Header
     
    15761676deallocate(dustfile)
    15771677deallocate(dustnfile)
     1678deallocate(ccnfile)
     1679deallocate(ccnnfile)
    15781680deallocate(psfile)
    15791681deallocate(tsfile)
Note: See TracChangeset for help on using the changeset viewer.