/[lmdze]/trunk/Sources/phylmd/histwrite_phy.f
ViewVC logotype

Contents of /trunk/Sources/phylmd/histwrite_phy.f

Parent Directory Parent Directory | Revision Log Revision Log


Revision 191 - (show annotations)
Mon May 9 19:56:28 2016 UTC (8 years ago) by guez
File size: 1112 byte(s)
Extracted the call to read_comdissnew out of conf_gcm.

Made ok_instan a variable of module clesphys, itau_phy a variable of
module phyetat0_m, nid_ins a variable of module ini_histins_m, itap a
variable of new module time_phylmdz, so that histwrite_phy can be
called from any procedure without the need to cascade those variables
into that procedure. Made itau_w a variable of module time_phylmdz so
that it is computed only once per time step of physics.

Extracted variables of module clesphys which were in namelist
conf_phys_nml into their own namelist, clesphys_nml, and created
procedure read_clesphys reading clesphys_nml, to avoid side effect.

No need for double precision in procedure getso4fromfile. Assume there
is a single variable for the whole year in the NetCDF file instead of
one variable per month.

Created generic procedure histwrite_phy and removed procedure
write_histins, following LMDZ. histwrite_phy has only two arguments,
can be called from anywhere, and should manage the logic of writing or
not writing into various history files with various operations. So the
test on ok_instan goes inside histwrite_phy.

Test for raz_date in phyetat0 instead of physiq to avoid side effect.

Created procedure increment_itap to avoid side effect.

Removed unnecessary differences between procedures readsulfate and
readsulfate_pi.

1 module histwrite_phy_m
2
3 use clesphys, only: ok_instan
4 use gr_phy_write_m, only: gr_phy_write
5 use histwrite_m, only: histwrite
6 use ini_histins_m, only: nid_ins
7 use time_phylmdz, only: itau_w
8
9 implicit none
10
11 INTEGER:: itap = 0 ! number of calls to "physiq"
12
13 INTERFACE histwrite_phy
14 MODULE PROCEDURE histwrite2d_phy, histwrite3d_phy
15 end INTERFACE histwrite_phy
16
17 private
18 public itap, histwrite_phy
19
20 contains
21
22 subroutine histwrite2d_phy(var, field)
23
24 character(len=*), intent(in):: var
25 real, intent(in):: field(:)
26
27 !-----------------------------------------------------------
28
29 IF (ok_instan) CALL histwrite(nid_ins, var, itau_w, gr_phy_write(field))
30
31 end subroutine histwrite2d_phy
32
33 !*************************************************************
34
35 subroutine histwrite3d_phy(var, field)
36
37 character(len=*), intent(in):: var
38 real, intent(in):: field(:, :)
39
40 !-----------------------------------------------------------
41
42 IF (ok_instan) CALL histwrite(nid_ins, var, itau_w, gr_phy_write(field))
43
44 end subroutine histwrite3d_phy
45
46 end module histwrite_phy_m

  ViewVC Help
Powered by ViewVC 1.1.21