Changeset 1590


Ignore:
Timestamp:
Aug 30, 2016, 3:04:29 PM (9 years ago)
Author:
aslmd
Message:

moved interface for outputs from module_lmd_driver to update_outputs_physiq_mod. updated the nophysics case by adding a case dynphy_wrf_void_lmd_new which will serve as a template for a physiq interface

Location:
trunk
Files:
5 added
8 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified trunk/LMDZ.MARS/libf/phymars/comm_wrf.F90

    r1236 r1590  
    33!!
    44!! This module is useful to output fields in WRF style
     5!! -- useful for diagnostics that are not already in modules
    56!!
    67
     
    2324  integer,intent(in) :: ngrid ! number of atmospheric columns
    2425  integer,intent(in) :: nlayer ! number of atmospheric layers
    25   allocate(comm_HR_SW(ngrid,nlayer))
    26   allocate(comm_HR_LW(ngrid,nlayer))
    27   allocate(comm_SWDOWNZ(ngrid))
    28   allocate(comm_TAU_DUST(ngrid))
    29   allocate(comm_RDUST(ngrid,nlayer))
    30   allocate(comm_QSURFDUST(ngrid))
    31   allocate(comm_MTOT(ngrid))
    32   allocate(comm_ICETOT(ngrid))
    33   allocate(comm_VMR_ICE(ngrid,nlayer))
    34   allocate(comm_TAU_ICE(ngrid))
    35   allocate(comm_RICE(ngrid,nlayer))
     26  if (.not.allocated(comm_HR_SW)) allocate(comm_HR_SW(ngrid,nlayer))
     27  if (.not.allocated(comm_HR_LW)) allocate(comm_HR_LW(ngrid,nlayer))
     28  if (.not.allocated(comm_SWDOWNZ)) allocate(comm_SWDOWNZ(ngrid))
     29  if (.not.allocated(comm_TAU_DUST)) allocate(comm_TAU_DUST(ngrid))
     30  if (.not.allocated(comm_RDUST)) allocate(comm_RDUST(ngrid,nlayer))
     31  if (.not.allocated(comm_QSURFDUST)) allocate(comm_QSURFDUST(ngrid))
     32  if (.not.allocated(comm_MTOT)) allocate(comm_MTOT(ngrid))
     33  if (.not.allocated(comm_ICETOT)) allocate(comm_ICETOT(ngrid))
     34  if (.not.allocated(comm_VMR_ICE)) allocate(comm_VMR_ICE(ngrid,nlayer))
     35  if (.not.allocated(comm_TAU_ICE)) allocate(comm_TAU_ICE(ngrid))
     36  if (.not.allocated(comm_RICE)) allocate(comm_RICE(ngrid,nlayer))
    3637  end subroutine allocate_comm_wrf
    3738
  • TabularUnified trunk/LMDZ.MARS/libf/phymars/physiq_mod.F

    r1579 r1590  
    19931993      !! --> example : hfmax_th, zmax_th
    19941994
     1995      CALL allocate_comm_wrf(ngrid,nlayer)
     1996
    19951997      !state  real  HR_SW     ikj   misc  1  -  h  "HR_SW"     "HEATING RATE SW"                 "K/s"
    19961998      comm_HR_SW(1:ngrid,1:nlayer) = zdtsw(1:ngrid,1:nlayer)
  • TabularUnified trunk/MESOSCALE/LMD_MM_MARS/SRC/LES/modif_mars/module_first_rk_step_part1.F

    r1586 r1590  
    644644     &        ,KM_OPT=config_flags%km_opt         &
    645645     &        ,HISTORY_INTERVAL=model_config_rec%history_interval(1)  &
    646 #ifndef NOPHYS
    647646          !------------------!
    648647          ! OUTPUT VARIABLES !
     
    667666#include "module_lmd_driver_output4.inc"
    668667#endif
    669 #endif
    670668     &        ,SLPX=grid%slpx,SLPY=grid%slpy,RESTART=config_flags%restart)
    671669ENDIF
  • TabularUnified trunk/MESOSCALE/LMD_MM_MARS/SRC/SCRIPTS/copy_model

    r1588 r1590  
    4747ln -sf $WRFSRC/WRFV2/call_meso_inifis?.inc .
    4848ln -sf $WRFSRC/WRFV2/call_meso_physiq?.inc .
    49 
    50 sed s+"YORGLYORGL"+"$laphysiq"+g $WRFSRC/WRFV2/physics.sed > physics.sed
    5149
    5250#\rm meso_dimphys.h
     
    139137mkdir external/io_mcel
    140138ln -sf $WRFSRC/WRFV2/external/io_mcel/* external/io_mcel/
    141 mkdir $laphysiq
    142 mkdir $laphysiq/libf
    143 ln -sf $WRFSRC/WRFV2/$laphysiq/makegcm* $laphysiq/
    144 ln -sf $WRFSRC/WRFV2/$laphysiq/meso_dimphys.h* $laphysiq/
    145 ln -sf $WRFSRC/WRFV2/$laphysiq/create_make_gcm $laphysiq/
    146 #ln -sf $WRFSRC/WRFV2/$laphysiq/makefile $laphysiq/
    147 ln -sf $WRFSRC/WRFV2/$laphysiq/libf/duplicate* $laphysiq/libf/
    148 ln -sf $WRFSRC/WRFV2/$laphysiq/libf/generate* $laphysiq/libf/
    149139
    150 mkdir $laphysiq/libf/grid
    151 ln -sf $WRFSRC/WRFV2/$laphysiq/libf/grid/* $laphysiq/libf/grid/
    152 mkdir $laphysiq/libf/phymars
    153 ln -sf $WRFSRC/WRFV2/$laphysiq/libf/phymars/* $laphysiq/libf/phymars/
    154 ln -sf $WRFSRC/WRFV2/$laphysiq/libf/phy_common/* $laphysiq/libf/phymars/
    155 mkdir $laphysiq/libf/dyn3d
    156 ln -sf $WRFSRC/WRFV2/$laphysiq/libf/dyn3d/* $laphysiq/libf/dyn3d/
    157 mkdir $laphysiq/libf/aeronomars
    158 ln -sf $WRFSRC/WRFV2/$laphysiq/libf/aeronomars/* $laphysiq/libf/aeronomars/
    159 mkdir $laphysiq/libf/bibio
    160 ln -sf $WRFSRC/WRFV2/$laphysiq/libf/bibio/* $laphysiq/libf/bibio/
    161 mkdir $laphysiq/libo
    162 #touch $laphysiq/makefile
     140if [[ "${laphysiq}" == *"void"* ]]
     141then
     142
     143  ## case with no physics
     144  rm -f physics.sed
     145  touch physics.sed
     146
     147else
     148
     149  ## case with physics
     150  mkdir $laphysiq
     151  mkdir $laphysiq/libf
     152  ln -sf $WRFSRC/WRFV2/$laphysiq/makegcm* $laphysiq/
     153  ln -sf $WRFSRC/WRFV2/$laphysiq/meso_dimphys.h* $laphysiq/
     154  ln -sf $WRFSRC/WRFV2/$laphysiq/create_make_gcm $laphysiq/
     155  #ln -sf $WRFSRC/WRFV2/$laphysiq/makefile $laphysiq/
     156  ln -sf $WRFSRC/WRFV2/$laphysiq/libf/duplicate* $laphysiq/libf/
     157  ln -sf $WRFSRC/WRFV2/$laphysiq/libf/generate* $laphysiq/libf/
     158
     159  mkdir $laphysiq/libf/grid
     160  ln -sf $WRFSRC/WRFV2/$laphysiq/libf/grid/* $laphysiq/libf/grid/
     161  mkdir $laphysiq/libf/phymars
     162  ln -sf $WRFSRC/WRFV2/$laphysiq/libf/phymars/* $laphysiq/libf/phymars/
     163  ln -sf $WRFSRC/WRFV2/$laphysiq/libf/phy_common/* $laphysiq/libf/phymars/
     164  mkdir $laphysiq/libf/dyn3d
     165  ln -sf $WRFSRC/WRFV2/$laphysiq/libf/dyn3d/* $laphysiq/libf/dyn3d/
     166  mkdir $laphysiq/libf/aeronomars
     167  ln -sf $WRFSRC/WRFV2/$laphysiq/libf/aeronomars/* $laphysiq/libf/aeronomars/
     168  mkdir $laphysiq/libf/bibio
     169  ln -sf $WRFSRC/WRFV2/$laphysiq/libf/bibio/* $laphysiq/libf/bibio/
     170  mkdir $laphysiq/libo
     171  #touch $laphysiq/makefile
     172
     173  \rm $laphysiq/libf/phymars/dimphys.h
     174
     175  sed s+"YORGLYORGL"+"$laphysiq"+g $WRFSRC/WRFV2/physics.sed > physics.sed
     176fi
    163177
    164178mkdir test
     
    167181ln -sf $WRFSRC/WRFV2/test/em_real/* test/em_real/
    168182
    169 cd $laphysiq/libf/phymars/
    170 \rm dimphys.h
    171 #ln -sf ../../../meso_dimphys.h dimphys.h
    172 cd ../../..
    173 
    174183echo '*** end'
    175184
  • TabularUnified trunk/MESOSCALE/LMD_MM_MARS/SRC/WRFV2/dyn_em/solve_em.F

    r1584 r1590  
    886886     &        ,KM_OPT=config_flags%km_opt         &
    887887     &        ,HISTORY_INTERVAL=model_config_rec%history_interval(1)  &
    888 #ifndef NOPHYS
    889888          !------------------!
    890889          ! OUTPUT VARIABLES !
     
    908907#else
    909908#include "module_lmd_driver_output4.inc"
    910 #endif
    911909#endif
    912910     &        ,SLPX=grid%slpx,SLPY=grid%slpy,RESTART=config_flags%restart)
  • TabularUnified trunk/MESOSCALE/LMD_MM_MARS/SRC/WRFV2/phys/dynphy_wrf_mars_lmd_new/update_outputs_physiq_mod.F

    r1582 r1590  
    153153END SUBROUTINE update_outputs_physiq_turb
    154154
     155!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
     156!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
     157SUBROUTINE update_outputs_physiq_diag( &
     158            ims,ime,jms,jme,kms,kme,&
     159            ips,ipe,jps,jpe,kps,kpe,&
     160            SWDOWNZ,TAU_DUST,QSURFDUST,&
     161            MTOT,ICETOT,TAU_ICE,&
     162            HR_SW,HR_LW,&
     163            RDUST,VMR_ICE,RICE)
     164
     165   USE comm_wrf !! to get fields to be written from physiq
     166
     167   INTEGER, INTENT(IN) :: ims,ime,jms,jme,kms,kme
     168   INTEGER, INTENT(IN) :: ips,ipe,jps,jpe,kps,kpe
     169   REAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT) :: &
     170     SWDOWNZ,TAU_DUST,QSURFDUST,&
     171     MTOT,ICETOT,TAU_ICE
     172   REAL, DIMENSION( ims:ime, kms:kme, jms:jme ), INTENT(INOUT ) :: &
     173     HR_SW,HR_LW,RDUST,VMR_ICE,RICE
     174   INTEGER :: i,j,subs
     175
     176   DO j = jps,jpe
     177   DO i = ips,ipe
     178
     179     !-----------------------------------!
     180     ! 1D subscript for physics "cursor" !
     181     !-----------------------------------!
     182     subs = (j-jps)*(ipe-ips+1)+(i-ips+1)
     183
     184     !! get diagnostics from physics
     185     SWDOWNZ(i,j) = comm_SWDOWNZ(subs)
     186     TAU_DUST(i,j) = comm_TAU_DUST(subs)
     187     QSURFDUST(i,j) = comm_QSURFDUST(subs)
     188     MTOT(i,j) = comm_MTOT(subs)
     189     ICETOT(i,j) = comm_ICETOT(subs)
     190     TAU_ICE(i,j) = comm_TAU_ICE(subs)
     191     HR_SW(i,kps:kpe,j) = comm_HR_SW(subs,kps:kpe)
     192     HR_LW(i,kps:kpe,j) = comm_HR_LW(subs,kps:kpe)
     193     RDUST(i,kps:kpe,j) = comm_RDUST(subs,kps:kpe)
     194     VMR_ICE(i,kps:kpe,j) = comm_VMR_ICE(subs,kps:kpe)
     195     RICE(i,kps:kpe,j) = comm_RICE(subs,kps:kpe)
     196
     197   ENDDO
     198   ENDDO
     199
     200   CALL deallocate_comm_wrf
     201
     202END SUBROUTINE update_outputs_physiq_diag
     203
    155204END MODULE update_outputs_physiq_mod
    156205
  • TabularUnified trunk/MESOSCALE/LMD_MM_MARS/SRC/WRFV2/phys/module_lmd_driver.F.new

    r1584 r1590  
    4040        isfflx, diff_opt, km_opt, &
    4141        HISTORY_INTERVAL, &
    42 ! sert a rien ce NOPHYS. il le faudrait sur tout.
    43 #ifndef NOPHYS
    4442        HR_SW,HR_LW,SWDOWNZ,&
    4543        TAU_DUST,RDUST,QSURFDUST,&
     
    4745        HFMAX,ZMAX,&
    4846        USTM,HFX,&
    49 #endif
    5047        SLPX,SLPY,RESTART)
    5148! NB: module_lmd_driver_output1.inc : output arguments generated from Registry
     
    6057   USE module_model_constants
    6158   USE module_wrf_error
    62 #ifndef NOPHYS
     59   !!!!!!!! interface modules
    6360   USE update_inputs_physiq_mod !! to set inputs for physiq
    6461   USE update_outputs_physiq_mod !! to get outputs from physiq
    65    USE comm_wrf !! to get fields to be written from physiq
    6662   USE iniphysiq_mod !! to get iniphysiq subroutine
    6763   USE callphysiq_mod !! to call the LMD physics
    68 #endif
     64   !!!!!!!! interface modules
    6965
    7066!==================================================================
     
    414410!----------!
    415411! inputs ...
    416 #ifndef NOPHYS
    417 CALL allocate_comm_wrf(ngrid,nlayer)
    418 #endif
    419412ALLOCATE(pplev(ngrid,nlayer+1))  !!!!!
    420413ALLOCATE(pplay(ngrid,nlayer))    !!!!!
     
    447440!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    448441
    449 #ifndef NOPHYS
    450442!! INITIALIZE AND ALLOCATE EVERYTHING !! here, only firstcall
    451443allocation_firstcall: IF (firstcall .EQV. .true.) THEN
     
    470462                     1./reradius,g,r_d,cp,1)
    471463ENDIF allocation_firstcall
    472 #endif
    473464
    474465!!*****************************!!
     
    657648pdt(:,:)=0.
    658649pdq(:,:,:)=0.
    659 #ifndef NOPHYS
    660650print *, '** ',planet_type,'** CALL TO LMD PHYSICS'
    661651!!!
     
    676666                       pdu,pdv,pdt,pdq,pdpsrf)
    677667!!!
    678 #endif
    679668
    680669!! specific scenario. necessary to add the right amount of dust.
     
    745734            M_Q2,M_WSTAR,&
    746735            HFMAX,ZMAX,USTM,HFX)
    747 
    748 DO j = jps,jpe
    749 DO i = ips,ipe
    750 
    751   subs = (j-jps)*(ipe-ips+1)+(i-ips+1)
    752 
    753   !! output only (cf comm_wrf)
    754   SWDOWNZ(i,j) = comm_SWDOWNZ(subs)
    755   TAU_DUST(i,j) = comm_TAU_DUST(subs)
    756   QSURFDUST(i,j) = comm_QSURFDUST(subs)
    757   MTOT(i,j) = comm_MTOT(subs)
    758   ICETOT(i,j) = comm_ICETOT(subs)
    759   TAU_ICE(i,j) = comm_TAU_ICE(subs)
    760   HR_SW(i,kps:kpe,j) = comm_HR_SW(subs,kps:kpe)
    761   HR_LW(i,kps:kpe,j) = comm_HR_LW(subs,kps:kpe)
    762   RDUST(i,kps:kpe,j) = comm_RDUST(subs,kps:kpe)
    763   VMR_ICE(i,kps:kpe,j) = comm_VMR_ICE(subs,kps:kpe)
    764   RICE(i,kps:kpe,j) = comm_RICE(subs,kps:kpe)
    765 
    766 ENDDO
    767 ENDDO
    768 
    769 CALL deallocate_comm_wrf
    770 
     736!!!
     737CALL update_outputs_physiq_diag( &
     738            ims,ime,jms,jme,kms,kme,&
     739            ips,ipe,jps,jpe,kps,kpe,&
     740            SWDOWNZ,TAU_DUST,QSURFDUST,&
     741            MTOT,ICETOT,TAU_ICE,&
     742            HR_SW,HR_LW,&
     743            RDUST,VMR_ICE,RICE)
     744!!!
    771745ENDIF call_physics
    772746
  • TabularUnified trunk/MESOSCALE/LMD_MM_MARS/makemeso

    r1588 r1590  
    4949   e ) from_scratch=1;;       ## a fresh start with a completely new folder
    5050   s ) scenario="${OPTARG}";; ## a specific scenario (with precompiling flags)
    51    x ) donotcompile=1;phys="nophys_";donotcompilephys=1;; ## a case with no LMD physics included
     51   x ) donotcompile=1;phys="void_lmd_new";donotcompilephys=1;; ## a case with no LMD physics included
    5252   h ) echo "
    5353# Use:   
     
    130130  esac
    131131  # number of processors
    132   if [[ "${phys}" == *"new"* ]] || [[ "${phys}" == "nophys_" ]]
     132  if [[ "${phys}" == *"new"* ]] #|| [[ "${phys}" == "nophys_" ]]
    133133  then
    134134   numproc=999
     
    183183    \rm what_folder 2> /dev/null
    184184    echo ${conf_wrf} > what_folder
    185          if [ ${donotcompile} -eq 1 ]
     185         if [ ${donotcompile} -eq 0 ]
    186186         then
    187             #\rm what_folder 2> /dev/null
    188             #echo '**********************'
    189             #echo '*** Your folder is ...'
    190             #echo '**********************'
    191             #echo ${conf_wrf} | tee what_folder
    192             #cat what_folder
    193             #echo ${conf_wrf} > what_folder
    194             #echo ${reply} > what_compilo
    195             #echo ${numproc} > what_numproc
    196             if [[ "${phys}" != "nophys_" ]]
    197             then
    198               exit
    199             fi
    200          else
     187            ##\rm what_folder 2> /dev/null
     188            ##echo '**********************'
     189            ##echo '*** Your folder is ...'
     190            ##echo '**********************'
     191            ##echo ${conf_wrf} | tee what_folder
     192            ##cat what_folder
     193            ##echo ${conf_wrf} > what_folder
     194            ##echo ${reply} > what_compilo
     195            ##echo ${numproc} > what_numproc
     196            #if [[ "${phys}" != "nophys_" ]]
     197            #then
     198            #  exit
     199            #fi
     200         #else
    201201            # tracers: now dynamically set in newphys 09/2013
    202202            if [[ "${phys}" == *"new"* ]]
     
    602602
    603603  ################
    604   if [[ "${phys}" == "nophys_" ]]
    605   then
    606      if [[ "${config}" == "les" ]]  ### LES is different because of WRFV3
    607      then
    608        sed s+"ARCH_LOCAL      =       "+"ARCH_LOCAL      =       -DNOPHYS "+g configure.wrf > yeah ; mv -f yeah configure.wrf
    609        sed s+"-L../$phys/libo -llmd"+""+g configure.wrf > yeah ; mv -f yeah configure.wrf
    610      else
    611        ### not tested yet but should be working 
    612        echo CAUTION CAUTION CAUTION NOT FULLY TESTED
    613        sed s+"ARCHFLAGS       =       "+"ARCHFLAGS       =       -DNOPHYS "+g configure.wrf > yeah ; mv -f yeah configure.wrf
    614        sed s+"-L../$phys/libo -llmd"+""+g configure.wrf > yeah ; mv -f yeah configure.wrf
    615      fi
    616   fi
     604  #if [[ "${phys}" == "nophys_" ]]
     605  #then
     606  #   if [[ "${config}" == "les" ]]  ### LES is different because of WRFV3
     607  #   then
     608  #     sed s+"ARCH_LOCAL      =       "+"ARCH_LOCAL      =       -DNOPHYS "+g configure.wrf > yeah ; mv -f yeah configure.wrf
     609  #     sed s+"-L../$phys/libo -llmd"+""+g configure.wrf > yeah ; mv -f yeah configure.wrf
     610  #   else
     611  #     ### not tested yet but should be working 
     612  #     echo CAUTION CAUTION CAUTION NOT FULLY TESTED
     613  #     sed s+"ARCHFLAGS       =       "+"ARCHFLAGS       =       -DNOPHYS "+g configure.wrf > yeah ; mv -f yeah configure.wrf
     614  #     sed s+"-L../$phys/libo -llmd"+""+g configure.wrf > yeah ; mv -f yeah configure.wrf
     615  #   fi
     616  #fi
    617617  ################
    618618
     
    792792  echo 2. compiling WRF dynamical core ...
    793793
    794   if [[ "${phys}" == "nophys_" ]]
    795   then
    796   echo 'NO LMD PHYSICS included'
    797   else
    798   if [[ ! ( -f "call_meso_physiq.inc" ) ]]
    799   then
    800     echo 'did you compile the physics ? no call_meso_physiq.inc !'
    801     exit
    802   fi
    803   fi
     794  #if [[ "${phys}" == "nophys_" ]]
     795  #then
     796  # echo 'NO LMD PHYSICS included'
     797  #else
     798  # if [[ ! ( -f "call_meso_physiq.inc" ) ]]
     799  # then
     800  #  echo 'did you compile the physics ? no call_meso_physiq.inc !'
     801  #  exit
     802  # fi
     803  #fi
    804804
    805805  # be sure to compile with the most recent physics
Note: See TracChangeset for help on using the changeset viewer.