source: LMDZ4/branches/LMDZ4-dev-20091210/libf/dyn3dpar/getparam.F90 @ 2678

Last change on this file since 2678 was 1222, checked in by Ehouarn Millour, 15 years ago

Changes and cleanups to enable compiling without physics
and without ioipsl.

IOIPSL related cleanups:

  • bibio/writehist.F encapsulate the routine (which needs IOIPSL to function)

with #ifdef IOIPSL flag.

  • dyn3d/abort_gcm.F, dyn3dpar/abort_gcm.F and dyn3dpar/getparam.F90: use ioipsl_getincom module when not compiling with IOIPSL library, in order to always be able to use getin() routine.
  • removed unused "use IOIPSL" in dyn3dpar/guide_p_mod.F90
  • calendar related issue: Initialize day_ref and annee_ref in iniacademic.F (i.e. when they are not read from start.nc file)

Earth-specific programs/routines/modules:
create_etat0.F, fluxstokenc.F, limit_netcdf.F, startvar.F
(versions in dyn3d and dyn3dpar)
These routines and modules, which by design and porpose are made to function with
Earth physics are encapsulated with #CPP_EARTH cpp flag.

Earth-specific instructions:

  • calls to qminimum (specific treatment of first 2 tracers, i.e. water) in dyn3d/caladvtrac.F, dyn3d/integrd.F, dyn3dpar/caladvtrac_p.F, dyn3dpar/integrd_p.F only if (planet_type == 'earth')

Interaction with parallel physics:

  • routine dyn3dpar/parallel.F90 uses "surface_data" module (which is in the physics ...) to know value of "type_ocean" . Encapsulated that with #ifdef CPP_EARTH and set to a default type_ocean="dummy" otherwise.
  • So far, only Earth physics are parallelized, so all the interaction between parallel dynamics and parallel physics are encapsulated with #ifdef CCP_EARTH (this way we can run parallel without any physics). The (dyn3dpar) routines which contains such interaction are: bands.F90, gr_dyn_fi_p.F, gr_fi_dyn_p.F, mod_interface_dyn_phys.F90 This should later (when improving dyn/phys interface) be encapsulated with a more general and appropriate #ifdef CPP_PHYS cpp flag.

I checked that these changes do not alter results (on the simple
32x24x11 bench) on Ciclad (seq & mpi), Brodie (seq, mpi & omp) and
Vargas (seq, mpi & omp).

EM

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 2.7 KB
Line 
1!
2! $Id: getparam.F90 1222 2009-08-07 11:48:33Z oboucher $
3!
4MODULE getparam
5#ifdef CPP_IOIPSL
6   USE IOIPSL
7#else
8! if not using IOIPSL, we still need to use (a local version of) getin
9   USE ioipsl_getincom
10#endif
11
12   INTERFACE getpar
13     MODULE PROCEDURE ini_getparam,fin_getparam,getparamr,getparami,getparaml
14   END INTERFACE
15
16   INTEGER, PARAMETER :: out_eff=99
17
18CONTAINS
19  SUBROUTINE ini_getparam(fichier)
20  USE parallel
21    !
22    IMPLICIT NONE
23    !
24    CHARACTER*(*) :: fichier
25    IF (mpi_rank==0) OPEN(out_eff,file=fichier,status='unknown',form='formatted')
26   
27  END SUBROUTINE ini_getparam
28
29  SUBROUTINE fin_getparam
30  USE parallel
31    !
32    IMPLICIT NONE
33    !
34      IF (mpi_rank==0) CLOSE(out_eff)
35
36  END SUBROUTINE fin_getparam
37
38  SUBROUTINE getparamr(TARGET,def_val,ret_val,comment)
39  USE parallel
40    !
41    IMPLICIT NONE
42    !
43    !   Get a real scalar. We first check if we find it
44    !   in the database and if not we get it from the run.def
45    !
46    !   getinr1d and getinr2d are written on the same pattern
47    !
48    CHARACTER*(*) :: TARGET
49    REAL :: def_val
50    REAL :: ret_val
51    CHARACTER*(*) :: comment
52
53    ret_val=def_val
54    call getin(TARGET,ret_val)
55
56    IF (mpi_rank==0) THEN
57      write(out_eff,*) '######################################'
58      write(out_eff,*) '#### ',comment,' #####'
59      write(out_eff,*) TARGET,'=',ret_val
60    ENDIF
61   
62  END SUBROUTINE getparamr
63
64  SUBROUTINE getparami(TARGET,def_val,ret_val,comment)
65  USE parallel
66    !
67    IMPLICIT NONE
68    !
69    !   Get a real scalar. We first check if we find it
70    !   in the database and if not we get it from the run.def
71    !
72    !   getinr1d and getinr2d are written on the same pattern
73    !
74    CHARACTER*(*) :: TARGET
75    INTEGER :: def_val
76    INTEGER :: ret_val
77    CHARACTER*(*) :: comment
78
79    ret_val=def_val
80    call getin(TARGET,ret_val)
81
82    IF (mpi_rank==0) THEN
83      write(out_eff,*) '######################################'
84      write(out_eff,*) '#### ',comment,' #####'
85      write(out_eff,*) comment
86      write(out_eff,*) TARGET,'=',ret_val
87    ENDIF
88   
89  END SUBROUTINE getparami
90
91  SUBROUTINE getparaml(TARGET,def_val,ret_val,comment)
92  USE parallel
93    !
94    IMPLICIT NONE
95    !
96    !   Get a real scalar. We first check if we find it
97    !   in the database and if not we get it from the run.def
98    !
99    !   getinr1d and getinr2d are written on the same pattern
100    !
101    CHARACTER*(*) :: TARGET
102    LOGICAL :: def_val
103    LOGICAL :: ret_val
104    CHARACTER*(*) :: comment
105
106    ret_val=def_val
107    call getin(TARGET,ret_val)
108
109    IF (mpi_rank==0) THEN
110      write(out_eff,*) '######################################'
111      write(out_eff,*) '#### ',comment,' #####'
112      write(out_eff,*) TARGET,'=',ret_val
113    ENDIF
114       
115  END SUBROUTINE getparaml
116
117
118END MODULE getparam
Note: See TracBrowser for help on using the repository browser.