source: LMDZ4/branches/LMDZ4-dev-20091210/libf/bibio/writehist.F @ 2570

Last change on this file since 2570 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: 3.0 KB
Line 
1!
2! $Id: writehist.F 1222 2009-08-07 11:48:33Z fairhead $
3!
4      subroutine writehist( histid, histvid, time, vcov,
5     ,                          ucov,teta,phi,q,masse,ps,phis)
6
7#ifdef CPP_IOIPSL
8      USE ioipsl
9#endif
10      USE infotrac, ONLY : nqtot, ttext
11      implicit none
12
13C
14C   Ecriture du fichier histoire au format IOIPSL
15C
16C   Appels succesifs des routines: histwrite
17C
18C   Entree:
19C      histid: ID du fichier histoire
20C      histvid:ID du fichier histoire pour les vents V (appele a disparaitre)
21C      time: temps de l'ecriture
22C      vcov: vents v covariants
23C      ucov: vents u covariants
24C      teta: temperature potentielle
25C      phi : geopotentiel instantane
26C      q   : traceurs
27C      masse: masse
28C      ps   :pression au sol
29C      phis : geopotentiel au sol
30C     
31C
32C   Sortie:
33C      fileid: ID du fichier netcdf cree
34C
35C   L. Fairhead, LMD, 03/99
36C
37C =====================================================================
38C
39C   Declarations
40#include "dimensions.h"
41#include "paramet.h"
42#include "comconst.h"
43#include "comvert.h"
44#include "comgeom.h"
45#include "temps.h"
46#include "ener.h"
47#include "logic.h"
48#include "description.h"
49#include "serre.h"
50#include "iniprint.h"
51
52C
53C   Arguments
54C
55
56      INTEGER histid, histvid
57      REAL vcov(ip1jm,llm),ucov(ip1jmp1,llm)
58      REAL teta(ip1jmp1,llm),phi(ip1jmp1,llm)                   
59      REAL ps(ip1jmp1),masse(ip1jmp1,llm)                   
60      REAL phis(ip1jmp1)                 
61      REAL q(ip1jmp1,llm,nqtot)
62      integer time
63
64
65#ifdef CPP_IOIPSL
66! This routine needs IOIPSL to work
67C   Variables locales
68C
69      integer iq, ii, ll
70      integer ndexu(ip1jmp1*llm),ndexv(ip1jm*llm),ndex2d(ip1jmp1)
71      logical ok_sync
72      integer itau_w
73C
74C  Initialisations
75C
76      ndexu = 0
77      ndexv = 0
78      ndex2d = 0
79      ok_sync =.TRUE.
80      itau_w = itau_dyn + time
81C
82C  Appels a histwrite pour l'ecriture des variables a sauvegarder
83C
84C  Vents U
85C
86      call histwrite(histid, 'ucov', itau_w, ucov,
87     .               iip1*jjp1*llm, ndexu)
88
89C
90C  Vents V
91C
92      call histwrite(histvid, 'vcov', itau_w, vcov,
93     .               iip1*jjm*llm, ndexv)
94
95C
96C  Temperature potentielle
97C
98      call histwrite(histid, 'teta', itau_w, teta,
99     .                iip1*jjp1*llm, ndexu)
100C
101C  Geopotentiel
102C
103      call histwrite(histid, 'phi', itau_w, phi,
104     .                iip1*jjp1*llm, ndexu)
105C
106C  Traceurs
107C
108        DO iq=1,nqtot
109          call histwrite(histid, ttext(iq), itau_w, q(:,:,iq),
110     .                   iip1*jjp1*llm, ndexu)
111        enddo
112C
113C  Masse
114C
115      call histwrite(histid, 'masse', itau_w, masse, iip1*jjp1, ndex2d)
116C
117C  Pression au sol
118C
119      call histwrite(histid, 'ps', itau_w, ps, iip1*jjp1, ndex2d)
120C
121C  Geopotentiel au sol
122C
123      call histwrite(histid, 'phis', itau_w, phis, iip1*jjp1, ndex2d)
124C
125C  Fin
126C
127      if (ok_sync) then
128        call histsync(histid)
129        call histsync(histvid)
130      endif
131#else
132! tell the user this routine should be run with ioipsl
133      write(lunout,*)"writehist: Warning this routine should not be",
134     &               " used without ioipsl"
135#endif
136! of #ifdef CPP_IOIPSL
137      return
138      end
Note: See TracBrowser for help on using the repository browser.