source: trunk/LMDZ.TITAN/libf/phytitan/inimufi.F90 @ 1926

Last change on this file since 1926 was 1926, checked in by jvatant, 7 years ago

1) Microphysics diags / outputs :


+ Add supplementary diagnostics outputs for microphysics ( precip, flux, rc ... ) ( new muphy_diag.F90 module )
+ Correct the outputs of microphys tracers to be in X/m-3 to be comparable to "standard values"

+ Also update the deftank callphys.def with latest revs modifs for microphysics

2) Condensation / chemistry updates :


+ Moved chemistry AFTER microphysics

  • To have mufi condensation before photochem
  • Chemistry called last coherent with the fact that it brings back fields to equilibrium

+ If 2D chemistry, make zonally averaged fields go through mufi and chem condensation

to have non saturated profiles in input of photochemistry
( other 'short' processes neglected as 2D -> no diurnal cycle, just seasonal evolution )

+ Also corrected the positivity check ( took Mars GCM syntax ) after chemistry ( could previously lead to negs )

3) Noticed a weird behaviour ( bug? ) :


+ If generalize the use of arrays *_indx for tracers, to get rid of ugly "iq+nmicro",

it ends up with weird results / crash in optim mode ( ok in debug ) but didn't find out why ...

--JVO

  • Property svn:executable set to *
File size: 2.7 KB
Line 
1subroutine inimufi(ptimestep)
2
3  use mmp_gcm
4  use callkeys_mod, only : callclouds, p_prod, tx_prod, rc_prod, air_rad
5  use tracer_h
6  use comcstfi_mod, only : g, rad, mugaz
7  use datafile_mod
8
9  implicit none
10
11
12  !============================================================================
13  !
14  !     Purpose
15  !     -------
16  !     This routine call mm_initialize which perform the global initialization
17  !     for the microphysical YAMMS model.
18  !     It also performs some sanity checks on microphysical tracer names.
19  !
20  !     Authors
21  !     -------
22  !     J. Vatant d'Ollone, J.Burgalat, S.Lebonnois (09/2017)
23  !
24  !============================================================================
25
26
27  !--------------------------
28  ! 0. Declarations
29  ! -------------------------
30
31  real, intent(in)                   :: ptimestep    ! Timestep (s)
32
33  integer :: i,idx
34  character(len=20), dimension(4), parameter :: aernames = &
35     (/"mu_m0as              ", "mu_m3as              ",   &
36       "mu_m0af              ", "mu_m3af              "/)
37  CHARACTER(len=20), DIMENSION(2), PARAMETER :: ccnnames = &
38     (/"mu_m0n               ", "mu_m3n               "/)
39  logical :: err
40
41  ! PATCH : YAMMS now allows to enable/disable effective g computations:
42  !  In the library it defaults to .true., in the GCM we do not want it !
43  mm_use_effg = .false.
44
45  !----------------------------------------------------
46  ! 1. Call microphysical model global initialization
47  ! ---------------------------------------------------
48
49  ! enable log for what it's worth...
50  ! mm_log = .true.
51 
52  call mmp_initialize(ptimestep,p_prod,tx_prod,rc_prod, &
53        rad,g,air_rad,mugaz,callclouds,config_mufi)
54
55   ! -------------------------
56   ! 2. Check names of tracers
57   ! -------------------------
58   err = .false.
59   DO i=1,size(aernames)
60     idx = indexOfTracer(TRIM(aernames(i)),.false.)
61     IF (idx <= 0) THEN
62       WRITE(*,*) "inimufi: '"//TRIM(aernames(i))//"' not found in tracers table."
63       err = .true.
64     ENDIF
65   ENDDO
66   IF (callclouds) THEN
67     DO i=1,size(ccnnames)
68       idx = indexOfTracer(TRIM(ccnnames(i)),.false.)
69       IF (idx <= 0) THEN
70         WRITE(*,*) "inimufi: '"//TRIM(ccnnames(i))//"' not found in tracers table."
71         err = .true.
72       ENDIF
73     ENDDO
74     ALLOCATE(ices_indx(mm_nesp))
75     ices_indx(:) = -1
76     DO i=1,mm_nesp
77       idx = indexOfTracer("mu_m3"//TRIM(mm_spcname(i)),.false.)
78       IF (idx <= 0) THEN
79         WRITE(*,*) "inimufi: 'mu_m3"//TRIM(mm_spcname(i))//"' not found in tracers table."
80         err = .true.
81       ELSE
82         ices_indx(i) = idx
83       ENDIF
84     ENDDO
85     IF (err) THEN
86       WRITE(*,*) "You loose.... Try again"
87       STOP
88     ENDIF
89   ENDIF
90
91end subroutine inimufi
Note: See TracBrowser for help on using the repository browser.