Changeset 2663


Ignore:
Timestamp:
Apr 19, 2022, 12:06:36 PM (3 years ago)
Author:
dbardet
Message:

Adding check_fields subroutine for checking field values after and before dynamics-to-physics and physics-to-dynamics transfers

Location:
trunk/LMDZ.GENERIC/libf/phystd
Files:
1 added
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/LMDZ.GENERIC/libf/phystd/physiq_mod.F90

    r2632 r2663  
    1313                  flxw,                    &
    1414                  pdu,pdv,pdt,pdq,pdpsrf)
    15  
     15
     16      use ioipsl_getin_p_mod, only: getin_p
    1617      use radinc_h, only : L_NSPECTI,L_NSPECTV,naerkind
    1718      use watercommon_h, only : RLVTT, Psat_water,epsi,su_watercycle, RV, T_h2o_ice_liq
     
    6162                              waterrain, global1d, szangle
    6263      use nonoro_gwd_ran_mod, only: nonoro_gwd_ran
     64      use check_fields_mod, only: check_physics_fields
    6365      use conc_mod, only: rnew, cpnew, ini_conc_mod
    6466      use phys_state_var_mod
     
    439441#endif
    440442
     443      ! flags to trigger extra sanity checks
     444      logical, save ::  check_physics_inputs=.false.
     445      logical, save ::  check_physics_outputs=.false.
     446!$OPM THREADPRIVATE(check_physics_inputs,check_physics_outputs)     
     447
    441448      ! Misc
    442449      character*2 :: str2
     
    451458! --------------------------------
    452459      if (firstcall) then
     460        call getin_p("check_physics_inputs", check_physics_inputs)
     461        call getin_p("check_physics_outputs", check_physics_outputs)
     462
    453463        ! Allocate saved arrays (except for 1D model, where this has already
    454464        ! been done)
     
    714724         write(*,*) "physiq: end of firstcall"
    715725      endif ! end of 'firstcall'
     726
     727      if (check_physics_inputs) then
     728         !check the validity of input fields coming from the dynamics
     729         call check_physics_fields("begin physiq:", pt, pu, pv, pplev, pq)
     730      endif
    716731
    717732! ------------------------------------------------------
     
    24072422#endif
    24082423     
     2424      if (check_physics_outputs) then
     2425         ! Check the validity of updated fields at the end of the physics step
     2426         call check_physics_fields("end of physiq:", zt, zu, zv, pplev, zq)
     2427      endif
     2428
    24092429      icount=icount+1
    24102430     
Note: See TracChangeset for help on using the changeset viewer.