source: trunk/LMDZ.GENERIC/libf/phystd/evap.F @ 1255

Last change on this file since 1255 was 787, checked in by aslmd, 12 years ago

LMDZ.GENERIC. (Sorry for long text but this is a quite major commit)

Paving the path for parallel computations. And moving towards a more flexible code.

Automatic allocation is used within all routines in phystd. No further mention to ngridmx and nqmx.

  1. ngridmx and nqmx are still used in LMDZ.GENERIC in the dyn3d part
  2. if the LMDZ4/LMDZ5 dynamical core is used, there is no more fixed dimensions ngridmx and nqmx --> a fully flexible parallel implementation is now possible (e.g. no need to recompile when changing numbers of processors)

The important stuff :

  • Compilation checked with ifort. OK with and without debug mode. No errors. Checked for: gcm, newstart, rcm1d, kcm1d
  • RUN GCM: Running an Earth test case. Comparison with previous revision --> debug mode : perfect match. bit by bit (diff command). checked with plots --> O1 mode : close match (checked with plots) --> O2 mode : sometimes up to 0.5 K departure.... BUT in this new version O2 and O1 are quite close while in previous version O1 and O2 differed by about, well, typically 0.5 K (pictures available on request)
  • RUN NEWSTART : perfect match (bit-by-bit) in either debug or normal mode.
  • RUN RCM1D : perfect match in normal mode.
  • RUN KCM1D : not tested (I don't know what is the use of kcm1d)

List of main changes :

  • Additional arguments to some subroutines (ngrid and nq)
  • F77 include strategy is obsolete and replaced by F90 module strategy In this new strategy arrays are allocatable and allocated once at first use This has to be done for all common featuring arrays defined with ngridmx or nqmx

surfdat.h >> surfdat_h.F90
tracer.h >> tracer_h.F90
comsaison.h >> comsaison_h.F90
comgeomfi.h >> comgeomfi_h.F90
comsoil.h >> comsoil_h.F90
comdiurn.h >> comdiurn_h.F90
fisice.h >> DELETED. was not used. probably a fossil.
watercap.h >> DELETED. variable put in surfdat_h.F90

  • F77 'save' strategy is obsolete and replaced by F90 'allocatable save' strategy (see previous point and e.g. new version of physiq.F90)
  • Suppressing any mention to advtrac.h which is a common in the dynamics and needs nqmx This was easily solved by adding an argument with tracer names, coming from the dynamics This is probably not a definitive solution, ... but this allows for generic physics to work easily with either LMDZ.GENERIC or LMDZ dynamical cores
  • Removing consistency tests between nq and nqmx ; and ngrid and ngridmx. No use now!
  • Adaptation of rcm1d, kcm1d, newstart given above-mentioned changes

A note on phyetat0 and soil_setting:

  • Now written so that a slice of horizontal size 'ngrid' starting at grid point 'cursor' is read in startfi.nc 'cursor' is defined in dimphys.h and initialized by inifis (or in newstart) this is useful for parallel computations. default behavior is the usual one : sequential runs, cursor is 1, size ngrid is the whole global domain

A note on an additional change :

  • nueffrad is now an argument to callcorrk as is the case for reffrad both are saved in physiq this is for consistency and lisibility (previously nueffrad was saved in callcorrk) ... but there is a call to a function which modifies nueffrad in physiq ... previously this was not modifying nueffrad (although it was quite cumbersome to detect this) ... to be conservative I kept this behaviour and highlighted it with an array nueffrad_dummy ... I added a comment because someone might want to change this
File size: 2.3 KB
Line 
1      subroutine evap(ngrid,nq,dtime,pt, pq, pdq, pdt, 
2     $     dqevap,dtevap, qevap, tevap)
3       
4      use watercommon_h
5      USE tracer_h
6
7      implicit none
8
9#include "dimensions.h"
10#include "dimphys.h"
11#include "comcstfi.h"
12
13!==================================================================
14!     
15!     Purpose
16!     -------
17!     Evaporation of all water in the atmopshere.
18!     
19!     Authors
20!     -------
21!     Adapted from the LMDTERRE code by B. Charnay (2010)
22!     Original author Z. X. Li (1993)
23!     
24!==================================================================
25
26      INTEGER ngrid,nq
27
28! Arguments:
29      REAL pt(ngrid,nlayermx)
30      REAL pq(ngrid,nlayermx,nq)
31      REAL pdt(ngrid,nlayermx)
32      REAL pdq(ngrid,nlayermx,nq)
33      REAL dqevap(ngrid,nlayermx)
34      REAL dtevap(ngrid,nlayermx)
35      REAL qevap(ngrid,nlayermx,nq)
36      REAL dtime
37 
38! Local:
39      REAL tevap(ngrid,nlayermx)
40      REAL zlvdcp
41      REAL zlsdcp
42      REAL zdelta
43      INTEGER l,ig
44
45!
46! Re-evaporer l'eau liquide nuageuse
47!
48
49      DO l=1,nlayermx
50        DO ig=1,ngrid
51         qevap(ig,l,igcm_h2o_vap)=pq(ig,l,igcm_h2o_vap)
52     s                            +pdq(ig,l,igcm_h2o_vap)*dtime
53         qevap(ig,l,igcm_h2o_ice)=pq(ig,l,igcm_h2o_ice)
54     s                            +pdq(ig,l,igcm_h2o_ice)*dtime
55         tevap(ig,l)=pt(ig,l)+pdt(ig,l)*dtime
56        ENDDO
57      ENDDO
58
59      DO l = 1, nlayermx 
60        DO ig = 1, ngrid
61         zlvdcp=RLVTT/RCPD!/(1.0+RVTMP2*qevap(ig,l,igcm_h2o_vap))
62         zlsdcp=RLSTT/RCPD!/(1.0+RVTMP2*qevap(ig,l,igcm_h2o_vap))
63         ! ignoring qevap term creates huge difference when qevap large!!!
64
65         zdelta = MAX(0.,SIGN(1.,T_h2O_ice_liq-tevap(ig,l))) ! what is this?
66                                                  ! for division between water / liquid
67         dqevap(ig,l) = MAX(0.0,qevap(ig,l,igcm_h2o_ice))/dtime
68         dtevap(ig,l) = - dqevap(ig,l)*RLVTT/RCPD ! exactly as in largescale.F
69!         dtevap(ig,l) = - dqevap(ig,l)
70!     s                       * (zlvdcp*(1.-zdelta)+zlsdcp*zdelta)
71         qevap(ig,l,igcm_h2o_vap) = qevap(ig,l,igcm_h2o_vap)   
72     s                              +dqevap(ig,l)*dtime
73         qevap(ig,l,igcm_h2o_ice) = 0.0
74         tevap(ig,l) = tevap(ig,l)+dtevap(ig,l)*dtime
75
76        ENDDO
77      ENDDO
78
79      RETURN
80      END
Note: See TracBrowser for help on using the repository browser.