Ignore:
Timestamp:
Aug 7, 2009, 1:48:33 PM (16 years ago)
Author:
Ehouarn Millour
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • LMDZ4/branches/LMDZ4-dev/libf/dyn3dpar/gcm.F

    r1220 r1222  
    1212      USE mod_const_mpi, ONLY: init_const_mpi
    1313      USE parallel
    14       USE mod_phys_lmdz_para, ONLY : klon_mpi_para_nb
    1514      USE infotrac
    1615      USE mod_interface_dyn_phys
     
    2322#ifdef CPP_EARTH
    2423      USE mod_grid_phy_lmdz
     24      USE mod_phys_lmdz_para, ONLY : klon_mpi_para_nb
    2525      USE mod_phys_lmdz_omp_data, ONLY: klon_omp
    2626      USE dimphy
     
    191191      endif ! of if (planet_type.eq."earth")
    192192      CALL set_bands
     193#ifdef CPP_EARTH
     194! Ehouarn: For now only Earth physics is parallel
    193195      CALL Init_interface_dyn_phys
     196#endif
    194197      CALL barrier
    195198
     
    320323     .  ' restart ne correspondent pas a celles lues dans '
    321324        write(lunout,*)' gcm.def'
     325        write(lunout,*)' annee_ref=',annee_ref," anneeref=",anneeref
     326        write(lunout,*)' day_ref=',day_ref," dayref=",dayref
    322327        if (raz_date .ne. 1) then
    323328          write(lunout,*)
     
    337342      endif
    338343
     344#ifdef CPP_IOIPSL
    339345      mois = 1
    340346      heure = 0.
     
    343349      jD_ref = int(jD_ref)
    344350
    345 #ifdef CPP_IOIPSL
    346351      call ioconf_startdate(annee_ref,1,day_ref, 0.)
    347 #endif
    348352
    349353      write(lunout,*)'DEBUG'
     
    353357      write(lunout,*)'jD_ref+jH_ref,an, mois, jour, heure'
    354358      write(lunout,*)jD_ref+jH_ref,an, mois, jour, heure
     359#else
     360! Ehouarn: we still need to define JD_ref and JH_ref
     361! and since we don't know how many days there are in a year
     362! we set JD_ref to 0 (this should be improved ...)
     363      jD_ref=0
     364      jH_ref=0
     365#endif
    355366
    356367c  nombre d'etats dans les fichiers demarrage et histoire
     
    436447      WRITE(lunout,300)day_ini,day_end
    437448 300  FORMAT('1'/,15x,'run du jour',i7,2x,'au jour',i7//)
     449
     450#ifdef CPP_IOIPSL
    438451      call ju2ymds(jD_ref + day_ini - day_ref, an, mois, jour, heure)
    439452      write (lunout,301)jour, mois, an
     
    442455 301  FORMAT('1'/,15x,'run du ', i2,'/',i2,'/',i4)
    443456 302  FORMAT('1'/,15x,'    au ', i2,'/',i2,'/',i4)
    444 
    445 !#ifdef CPP_IOIPSL
     457#endif
     458
    446459      if (planet_type.eq."earth") then
    447 #ifdef CPP_EARTH
    448       CALL dynredem0_p("restart.nc", day_end, phis)
    449 #endif
     460        CALL dynredem0_p("restart.nc", day_end, phis)
    450461      endif
    451462
Note: See TracChangeset for help on using the changeset viewer.