Changeset 1222


Ignore:
Timestamp:
Aug 7, 2009, 1:48:33 PM (15 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

Location:
LMDZ4/branches/LMDZ4-dev/libf
Files:
30 edited

Legend:

Unmodified
Added
Removed
  • LMDZ4/branches/LMDZ4-dev/libf/bibio/writehist.F

    r1114 r1222  
    11!
    2 ! $Header$
     2! $Id$
    33!
    44      subroutine writehist( histid, histvid, time, vcov,
    55     ,                          ucov,teta,phi,q,masse,ps,phis)
    66
     7#ifdef CPP_IOIPSL
    78      USE ioipsl
     9#endif
    810      USE infotrac, ONLY : nqtot, ttext
    911      implicit none
     
    4648#include "description.h"
    4749#include "serre.h"
     50#include "iniprint.h"
    4851
    4952C
     
    6063
    6164
     65#ifdef CPP_IOIPSL
     66! This routine needs IOIPSL to work
    6267C   Variables locales
    6368C
     
    124129        call histsync(histvid)
    125130      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
    126137      return
    127138      end
  • LMDZ4/branches/LMDZ4-dev/libf/dyn3d/abort_gcm.F

    r1200 r1222  
    88#ifdef CPP_IOIPSL
    99      USE IOIPSL
     10#else
     11! if not using IOIPSL, we still need to use (a local version of) getin_dump
     12      USE ioipsl_getincom
    1013#endif
    1114#include "iniprint.h"
  • LMDZ4/branches/LMDZ4-dev/libf/dyn3d/caladvtrac.F

    r1114 r1222  
    7676           ENDDO
    7777          ENDDO
    78 
    79           CALL qminimum( q, 2, finmasse )
     78         
     79          if (planet_type.eq."earth") then
     80! Earth-specific treatment of first 2 tracers (water)
     81            CALL qminimum( q, 2, finmasse )
     82          endif
    8083
    8184          CALL SCOPY   ( ip1jmp1*llm, masse, 1, finmasse,       1 )
  • LMDZ4/branches/LMDZ4-dev/libf/dyn3d/calfis.F

    r1201 r1222  
    177177c    --------------------
    178178c
    179 
    180       IF (ngridmx.NE.2+(jjm-1)*iim) THEN
     179c
     180      IF ( firstcal )  THEN
     181        debut = .TRUE.
     182        IF (ngridmx.NE.2+(jjm-1)*iim) THEN
    181183         PRINT*,'STOP dans calfis'
    182184         PRINT*,'La dimension ngridmx doit etre egale a 2 + (jjm-1)*iim'
     
    184186         PRINT*,ngridmx,jjm,iim
    185187         STOP
    186       ENDIF
    187 
    188 c-----------------------------------------------------------------------
    189 c   latitude, longitude et aires des mailles pour la physique:
    190 c   ----------------------------------------------------------
    191 
    192 c
    193       IF ( firstcal )  THEN
    194           debut = .TRUE.
     188        ENDIF
    195189      ELSE
    196           debut = .FALSE.
    197       ENDIF
     190        debut = .FALSE.
     191      ENDIF ! of IF (firstcal)
    198192
    199193c
     
    290284
    291285c   convergence dynamique pour les traceurs "EAU"
    292 
    293       DO iq=1,2
     286! Earth-specific treatment of first 2 tracers (water)
     287       if (planet_type=="earth") then
     288        DO iq=1,2
    294289         DO l=1,llm
    295290            pcvgq(1,l,iq)= pdq(1,1,l,iq) / pmasse(1,1,l)
     
    303298            pcvgq(ig0,l,iq)= pdq(1,jjp1,l,iq) / pmasse(1,jjp1,l)
    304299         ENDDO
    305       ENDDO
     300        ENDDO
     301       endif ! of if (planet_type=="earth")
    306302
    307303
     
    428424      ENDDO
    429425c
     426      if (planet_type=="earth") then
     427#ifdef CPP_EARTH
    430428cIM calcul PV a teta=350, 380, 405K
    431429      CALL PVtheta(ngridmx,llm,pucov,pvcov,pteta,
    432430     $           ztfi,zplay,zplev,
    433431     $           ntetaSTD,rtetaSTD,PVteta)
     432#endif
     433      endif
    434434c
    435435c On change de grille, dynamique vers physiq, pour le flux de masse verticale
     
    441441
    442442
     443      if (planet_type=="earth") then
     444#ifdef CPP_EARTH
    443445      CALL physiq (ngridmx,
    444446     .             llm,
     
    467469     .             pducov,
    468470     .             PVteta)
     471#endif
     472      endif !of if (planet_type=="earth")
    469473
    470474500   CONTINUE
     
    502506c   62. humidite specifique
    503507c   ---------------------
    504 
    505       DO iq=1,nqtot
    506          DO l=1,llm
    507             DO i=1,iip1
    508                pdqfi(i,1,l,iq)    = zdqfi(1,l,iq)
    509                pdqfi(i,jjp1,l,iq) = zdqfi(ngridmx,l,iq)
    510             ENDDO
    511             DO j=2,jjm
    512                ig0=1+(j-2)*iim
    513                DO i=1,iim
    514                   pdqfi(i,j,l,iq) = zdqfi(ig0+i,l,iq)
    515                ENDDO
    516                pdqfi(iip1,j,l,iq) = pdqfi(1,j,l,iq)
    517             ENDDO
    518          ENDDO
    519       ENDDO
     508! Ehouarn: removed this useless bit: was overwritten at step 63 anyways
     509!      DO iq=1,nqtot
     510!         DO l=1,llm
     511!            DO i=1,iip1
     512!               pdqfi(i,1,l,iq)    = zdqfi(1,l,iq)
     513!               pdqfi(i,jjp1,l,iq) = zdqfi(ngridmx,l,iq)
     514!            ENDDO
     515!            DO j=2,jjm
     516!               ig0=1+(j-2)*iim
     517!               DO i=1,iim
     518!                  pdqfi(i,j,l,iq) = zdqfi(ig0+i,l,iq)
     519!               ENDDO
     520!               pdqfi(iip1,j,l,iq) = pdqfi(1,j,l,iq)
     521!            ENDDO
     522!         ENDDO
     523!      ENDDO
    520524
    521525c   63. traceurs
    522526c   ------------
    523527C     initialisation des tendances
    524       pdqfi=0.
     528      pdqfi(:,:,:,:)=0.
    525529C
    526530      DO iq=1,nqtot
  • LMDZ4/branches/LMDZ4-dev/libf/dyn3d/create_etat0_limit.F

    r1220 r1222  
    11!
    2 ! $Header$
     2! $Id$
    33!
    44       PROGRAM create_etat0_limit
     5#ifdef CPP_EARTH
     6! This prog. is designed to work for Earth
    57       USE dimphy
    68       USE comgeomphy
     
    67691     FORMAT(//)
    6870
     71#endif
     72! of #ifdef CPP_EARTH
    6973      STOP
    7074      END
  • LMDZ4/branches/LMDZ4-dev/libf/dyn3d/fluxstokenc.F

    r1114 r1222  
     1!
     2! $Id$
     3!
    14      SUBROUTINE fluxstokenc(pbaru,pbarv,masse,teta,phi,phis,
    25     . time_step,itau )
     6#ifdef CPP_EARTH
     7! This routine is designed to work for Earth and with ioipsl
    38
    49       USE IOIPSL
     
    1823#include "tracstoke.h"
    1924#include "temps.h"
     25#include "iniprint.h"
    2026
    2127      REAL time_step,t_wrt, t_ops
     
    159165      ENDIF ! if iadvtr.EQ.istdyn
    160166
     167#else
     168      write(lunout,*)
     169     & 'fluxstokenc: Needs Earth physics (and ioipsl) to function'
     170#endif
     171! of #ifdef CPP_EARTH
    161172      RETURN
    162173      END
  • LMDZ4/branches/LMDZ4-dev/libf/dyn3d/gcm.F

    r1220 r1222  
    307307     .  ' restart ne correspondent pas a celles lues dans '
    308308        write(lunout,*)' gcm.def'
     309        write(lunout,*)' annee_ref=',annee_ref," anneeref=",anneeref
     310        write(lunout,*)' day_ref=',day_ref," dayref=",dayref
    309311        if (raz_date .ne. 1) then
    310312          write(lunout,*)
     
    324326      endif
    325327
     328#ifdef CPP_IOIPSL
    326329      mois = 1
    327330      heure = 0.
     
    330333      jD_ref = int(jD_ref)
    331334
    332 #ifdef CPP_IOIPSL
    333335      call ioconf_startdate(annee_ref,1,day_ref, 0.)
    334 #endif
    335336
    336337      write(lunout,*)'DEBUG'
     
    340341      write(lunout,*)'jD_ref+jH_ref,an, mois, jour, heure'
    341342      write(lunout,*)jD_ref+jH_ref,an, mois, jour, heure
     343#else
     344! Ehouarn: we still need to define JD_ref and JH_ref
     345! and since we don't know how many days there are in a year
     346! we set JD_ref to 0 (this should be improved ...)
     347      jD_ref=0
     348      jH_ref=0
     349#endif
    342350
    343351c  nombre d'etats dans les fichiers demarrage et histoire
     
    413421      WRITE(lunout,300)day_ini,day_end
    414422 300  FORMAT('1'/,15x,'run du jour',i7,2x,'au jour',i7//)
     423
     424#ifdef CPP_IOIPSL
    415425      call ju2ymds(jD_ref + day_ini - day_ref, an, mois, jour, heure)
    416426      write (lunout,301)jour, mois, an
     
    419429 301  FORMAT('1'/,15x,'run du ', i2,'/',i2,'/',i4)
    420430 302  FORMAT('1'/,15x,'    au ', i2,'/',i2,'/',i4)
     431#endif
    421432
    422433      if (planet_type.eq."earth") then
    423 #ifdef CPP_EARTH
    424       CALL dynredem0("restart.nc", day_end, phis)
    425 #endif
     434        CALL dynredem0("restart.nc", day_end, phis)
    426435      endif
    427436
  • LMDZ4/branches/LMDZ4-dev/libf/dyn3d/iniacademic.F

    r1140 r1222  
    8383c
    8484        time_0=0.
     85        day_ref=0
     86        annee_ref=0
    8587
    8688        im         = iim
  • LMDZ4/branches/LMDZ4-dev/libf/dyn3d/integrd.F

    r1114 r1222  
    11!
    2 ! $Header$
     2! $Id$
    33!
    44      SUBROUTINE integrd
     
    3232#include "temps.h"
    3333#include "serre.h"
     34#include "control.h"
    3435
    3536c   Arguments:
     
    183184c$$$      ENDIF
    184185
    185          DO l = 1, llm
    186           DO ij = 1, ip1jmp1
    187            deltap(ij,l) =  p(ij,l) - p(ij,l+1)
     186         if (planet_type.eq."earth") then
     187! Earth-specific treatment of first 2 tracers (water)
     188          DO l = 1, llm
     189           DO ij = 1, ip1jmp1
     190            deltap(ij,l) =  p(ij,l) - p(ij,l+1)
     191           ENDDO
    188192          ENDDO
    189          ENDDO
    190 
    191          CALL qminimum( q, nq, deltap )
     193
     194          CALL qminimum( q, nq, deltap )
     195         endif ! of if (planet_type.eq."earth")
     196
    192197c
    193198c    .....  Calcul de la valeur moyenne, unique  aux poles pour  q .....
  • LMDZ4/branches/LMDZ4-dev/libf/dyn3d/leapfrog.F

    r1220 r1222  
    597597
    598598              if (planet_type.eq."earth") then
    599 #ifdef CPP_EARTH
    600599! Write an Earth-format restart file
    601600                CALL dynredem1("restart.nc",0.0,
    602601     &                         vcov,ucov,teta,q,masse,ps)
    603 #endif
    604602              endif ! of if (planet_type.eq."earth")
    605603
     
    704702              IF(itau.EQ.itaufin) THEN
    705703                if (planet_type.eq."earth") then
    706 #ifdef CPP_EARTH
    707704                  CALL dynredem1("restart.nc",0.0,
    708705     &                           vcov,ucov,teta,q,masse,ps)
    709 #endif
    710706                endif ! of if (planet_type.eq."earth")
    711707              ENDIF ! of IF(itau.EQ.itaufin)
  • LMDZ4/branches/LMDZ4-dev/libf/dyn3d/limit_netcdf.F

    r997 r1222  
    11!
    2 ! $Header$
     2! $Id$
    33!
    44C
    55C
    66      SUBROUTINE limit_netcdf(interbar, extrap, oldice, masque)
     7#ifdef CPP_EARTH
     8! This routine is designed to work for Earth
    79      USE dimphy
    810      use phys_state_var_mod , ONLY : pctsrf
     
    3335cy#include "dimphy.h"
    3436#include "indicesol.h"
     37#include "iniprint.h"
    3538c
    3639c-----------------------------------------------------------------------
     
    13231326      ierr = NF_CLOSE(nid)
    13241327c
     1328#else
     1329      WRITE(lunout,*)
     1330     & 'limit_netcdf: Earth-specific routine, needs Earth physics'
     1331#endif
     1332! of #ifdef CPP_EARTH
    13251333      STOP
    13261334      END
  • LMDZ4/branches/LMDZ4-dev/libf/dyn3d/startvar.F

    r677 r1222  
    11!
    2 ! $Header$
     2! $Id$
    33!
    4 C
    5 C
    64      MODULE startvar
     5#ifdef CPP_EARTH
     6! This module is designed to work for Earth (and with ioipsl)
    77    !
    88    !
     
    11891189      END SUBROUTINE start_inter_3d
    11901190    !
     1191#endif
     1192! of #ifdef CPP_EARTH
    11911193      END MODULE startvar
  • LMDZ4/branches/LMDZ4-dev/libf/dyn3dpar/abort_gcm.F

    r1219 r1222  
    11!
    2 ! $Header$
     2! $Id$
    33!
    44c
     
    88#ifdef CPP_IOIPSL
    99      USE IOIPSL
     10#else
     11! if not using IOIPSL, we still need to use (a local version of) getin_dump
     12      USE ioipsl_getincom
    1013#endif
    1114      USE parallel
  • LMDZ4/branches/LMDZ4-dev/libf/dyn3dpar/bands.F90

    r792 r1222  
     1!
     2! $Id$
     3!
    14  module Bands
    25 
     
    9093   SUBROUTINE  Set_Bands
    9194     USE parallel
     95#ifdef CPP_EARTH
     96! Ehouarn: what follows is only related to // physics; for now only for Earth
    9297     USE mod_phys_lmdz_para, ONLY : jj_para_begin,jj_para_end
     98#endif
    9399     IMPLICIT NONE
    94100     INCLUDE 'dimensions.h'   
     
    100106      enddo
    101107         
     108#ifdef CPP_EARTH
     109! Ehouarn: what follows is only related to // physics; for now only for Earth         
    102110      do i=0,MPI_Size-1
    103111        jj_Nb_physic(i)=jj_para_end(i)-jj_para_begin(i)+1
     
    120128        endif
    121129      enddo
     130#endif     
    122131     
    123132    end subroutine Set_Bands
     
    323332    subroutine AdjustBands_physic
    324333      use times
     334#ifdef CPP_EARTH
     335! Ehouarn: what follows is only related to // physics; for now only for Earth
    325336      USE mod_phys_lmdz_para, only : klon_mpi_para_nb
     337#endif
    326338      USE parallel
    327339      implicit none
     
    347359      medium=medium/mpi_size     
    348360      NbTot=0
     361#ifdef CPP_EARTH
     362! Ehouarn: what follows is only related to // physics; for now only for Earth
    349363      do i=0,mpi_size-1
    350364        Inc(i)=nint(klon_mpi_para_nb(i)*(medium-value(i))/value(i))
     
    369383        distrib_phys(i)=klon_mpi_para_nb(i)+inc(i)
    370384      enddo
    371      
     385#endif     
    372386    end subroutine AdjustBands_physic
    373387
  • LMDZ4/branches/LMDZ4-dev/libf/dyn3dpar/caladvtrac_p.F

    r1114 r1222  
    8282          ENDDO
    8383
    84           CALL qminimum_p( q, 2, finmasse )
     84          if (planet_type.eq."earth") then
     85! Earth-specific treatment of first 2 tracers (water)
     86            CALL qminimum_p( q, 2, finmasse )
     87          endif
     88
    8589
    8690cym   --> le reste ne set a rien
  • LMDZ4/branches/LMDZ4-dev/libf/dyn3dpar/calfis_p.F

    r1207 r1222  
    2727     $                  pdqfi,
    2828     $                  pdpsfi)
     29#ifdef CPP_EARTH
     30! Ehouarn: For now, calfis_p needs Earth physics
    2931c
    3032c    Auteur :  P. Le Van, F. Hourdin
     
    232234      PVteta(:,:)=0.
    233235           
    234       IF (ngridmx.NE.2+(jjm-1)*iim) THEN
     236c
     237      IF ( firstcal )  THEN
     238        debut = .TRUE.
     239        IF (ngridmx.NE.2+(jjm-1)*iim) THEN
    235240         PRINT*,'STOP dans calfis'
    236241         PRINT*,'La dimension ngridmx doit etre egale a 2 + (jjm-1)*iim'
     
    238243         PRINT*,ngridmx,jjm,iim
    239244         STOP
    240       ENDIF
    241 
    242 c-----------------------------------------------------------------------
    243 c   latitude, longitude et aires des mailles pour la physique:
    244 c   ----------------------------------------------------------
    245 
    246 c
    247       IF ( firstcal )  THEN
    248           debut = .TRUE.
     245        ENDIF
    249246c$OMP MASTER
    250247      ALLOCATE(zpsrf(klon))
     
    348345
    349346c   convergence dynamique pour les traceurs "EAU"
    350 
    351       DO iq=1,2
     347! Earth-specific treatment of first 2 tracers (water)
     348      if (planet_type=="earth") then
     349       DO iq=1,2
    352350c$OMP DO SCHEDULE(STATIC,OMP_CHUNK)     
    353351         DO l=1,llm
     
    359357         ENDDO
    360358c$OMP END DO NOWAIT     
    361       ENDDO
    362 
     359       ENDDO
     360      endif ! of if (planet_type=="earth")
    363361
    364362
     
    508506
    509507      IF (is_sequential) THEN
     508        if (planet_type=="earth") then
     509#ifdef CPP_EARTH
    510510c
    511511cIM calcul PV a teta=350, 380, 405K
     
    514514     $           ntetaSTD,rtetaSTD,PVteta)
    515515c
     516#endif
     517        endif
    516518      ENDIF
    517519
     
    660662cym      call WriteField_phy_p('zdtfi_omp',zdtfi_omp(:,:),llm)
    661663     
     664      if (planet_type=="earth") then
     665#ifdef CPP_EARTH
    662666      CALL physiq (klon,
    663667     .             llm,
     
    689693     .             pducov,
    690694     .             PVteta)
     695#endif
     696      endif !of if (planet_type=="earth")
    691697
    692698cym      call WriteField_phy_p('zdtfi_omp',zdtfi_omp(:,:),llm)
     
    931937c   62. humidite specifique
    932938c   ---------------------
    933 
    934       DO iq=1,nqtot
    935 c$OMP DO SCHEDULE(STATIC,OMP_CHUNK)
    936          DO l=1,llm
    937 !!cdir NODEP
    938            do ig0=kstart,kend
    939              i=index_i(ig0)
    940              j=index_j(ig0)
    941              pdqfi(i,j,l,iq) = zdqfi(ig0,l,iq)
    942              if (i==1) pdqfi(iip1,j,l,iq) = zdqfi(ig0,l,iq)
    943            enddo
    944            
    945            if (is_north_pole) then
    946              do i=1,iip1
    947                pdqfi(i,1,l,iq)    = zdqfi(1,l,iq)             
    948              enddo
    949            endif
    950            
    951            if (is_south_pole) then
    952              do i=1,iip1
    953                pdqfi(i,jjp1,l,iq) = zdqfi(klon,l,iq)
    954              enddo
    955            endif
    956            
    957          ENDDO
    958 c$OMP END DO NOWAIT
    959       ENDDO
     939! Ehouarn: removed this useless bit: was overwritten at step 63 anyways
     940!      DO iq=1,nqtot
     941!c$OMP DO SCHEDULE(STATIC,OMP_CHUNK)
     942!         DO l=1,llm
     943!!!cdir NODEP
     944!           do ig0=kstart,kend
     945!             i=index_i(ig0)
     946!             j=index_j(ig0)
     947!             pdqfi(i,j,l,iq) = zdqfi(ig0,l,iq)
     948!             if (i==1) pdqfi(iip1,j,l,iq) = zdqfi(ig0,l,iq)
     949!           enddo
     950!           
     951!           if (is_north_pole) then
     952!             do i=1,iip1
     953!               pdqfi(i,1,l,iq)    = zdqfi(1,l,iq)             
     954!             enddo
     955!           endif
     956!           
     957!           if (is_south_pole) then
     958!             do i=1,iip1
     959!               pdqfi(i,jjp1,l,iq) = zdqfi(klon,l,iq)
     960!             enddo
     961!           endif
     962!         ENDDO
     963!c$OMP END DO NOWAIT
     964!      ENDDO
    960965
    961966c   63. traceurs
     
    11101115      firstcal = .FALSE.
    11111116
     1117#else
     1118      write(*,*) "calfis_p: for now can only work with parallel physics"
     1119      stop
     1120#endif
     1121! of #ifdef CPP_EARTH
    11121122      RETURN
    11131123      END
  • LMDZ4/branches/LMDZ4-dev/libf/dyn3dpar/create_etat0_limit.F

    r1220 r1222  
    11!
    2 ! $Header$
     2! $Id$
    33!
    44       PROGRAM create_etat0_limit
     5#ifdef CPP_EARTH
     6! This prog. is designed to work for Earth
    57       USE dimphy
    68       USE comgeomphy
     
    82841     FORMAT(//)
    8385
     86#endif
     87! of #ifdef CPP_EARTH
    8488      STOP
    8589      END
  • LMDZ4/branches/LMDZ4-dev/libf/dyn3dpar/fluxstokenc_p.F

    r1114 r1222  
     1!
     2! $Id$
     3!
    14      SUBROUTINE fluxstokenc_p(pbaru,pbarv,masse,teta,phi,phis,
    25     . time_step,itau )
     6#ifdef CPP_EARTH
     7! This routine is designed to work for Earth and with ioipsl
    38
    49       USE IOIPSL
     
    2126#include "tracstoke.h"
    2227#include "temps.h"
     28#include "iniprint.h"
    2329
    2430      REAL time_step,t_wrt, t_ops
     
    236242      ENDIF ! if iadvtr.EQ.istdyn
    237243
     244#else
     245      write(lunout,*)
     246     & 'fluxstokenc: Needs Earth physics (and ioipsl) to function'
     247#endif
     248! of #ifdef CPP_EARTH
    238249      RETURN
    239250      END
  • 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
  • LMDZ4/branches/LMDZ4-dev/libf/dyn3dpar/getparam.F90

    r1195 r1222  
    11!
    2 ! $Header$
     2! $Id$
    33!
    44MODULE getparam
     5#ifdef CPP_IOIPSL
    56   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
    612   INTERFACE getpar
    713     MODULE PROCEDURE ini_getparam,fin_getparam,getparamr,getparami,getparaml
  • LMDZ4/branches/LMDZ4-dev/libf/dyn3dpar/gr_dyn_fi_p.F

    r774 r1222  
     1!
     2! $Id$
     3!
    14      SUBROUTINE gr_dyn_fi_p(nfield,im,jm,ngrid,pdyn,pfi)
     5#ifdef CPP_EARTH
     6! Interface with parallel physics,
     7! for now this routine only works with Earth physics
    28      USE mod_interface_dyn_phys
    39      USE dimphy
     
    3440      ENDDO
    3541c$OMP END DO NOWAIT
     42#else
     43      write(lunout,*) "gr_fi_dyn_p : This routine should not be called",
     44     &   "without parallelized physics"
     45      stop
     46#endif
     47! of #ifdef CPP_EARTH
    3648      RETURN
    3749      END
  • LMDZ4/branches/LMDZ4-dev/libf/dyn3dpar/gr_fi_dyn_p.F

    r774 r1222  
     1!
     2! $Id$
     3!
    14      SUBROUTINE gr_fi_dyn_p(nfield,ngrid,im,jm,pfi,pdyn)
     5#ifdef CPP_EARTH
     6! Interface with parallel physics,
     7! for now this routine only works with Earth physics
    28      USE mod_interface_dyn_phys
    39      USE dimphy
     
    4652      ENDDO
    4753c$OMP END DO NOWAIT
     54#else
     55      write(lunout,*) "gr_fi_dyn_p : This routine should not be called",
     56     &   "without parallelized physics"
     57      stop
     58#endif
     59! of #ifdef CPP_EARTH
    4860      RETURN
    4961      END
  • LMDZ4/branches/LMDZ4-dev/libf/dyn3dpar/guide_p_mod.F90

    r1188 r1222  
    99!=======================================================================
    1010
    11   USE ioipsl
    1211  USE getparam
    1312  USE Write_Field_p
  • LMDZ4/branches/LMDZ4-dev/libf/dyn3dpar/iniacademic.F

    r1140 r1222  
    8383c
    8484        time_0=0.
     85        day_ref=0
     86        annee_ref=0
    8587
    8688        im         = iim
  • LMDZ4/branches/LMDZ4-dev/libf/dyn3dpar/integrd_p.F

    r1114 r1222  
    11!
    2 ! $Header$
     2! $Id$
    33!
    44      SUBROUTINE integrd_p
     
    3232#include "temps.h"
    3333#include "serre.h"
     34#include "control.h"
    3435
    3536c   Arguments:
     
    264265      ijb=ij_begin
    265266      ije=ij_end
    266      
     267
     268         if (planet_type.eq."earth") then
     269! Earth-specific treatment of first 2 tracers (water)
    267270c$OMP BARRIER
    268271c$OMP DO SCHEDULE(STATIC,OMP_CHUNK)
    269          DO l = 1, llm
    270           DO ij = ijb, ije
    271            deltap(ij,l) =  p(ij,l) - p(ij,l+1)
     272          DO l = 1, llm
     273           DO ij = ijb, ije
     274            deltap(ij,l) =  p(ij,l) - p(ij,l+1)
     275           ENDDO
    272276          ENDDO
    273          ENDDO
    274 c$OMP END DO NOWAIT
    275 c$OMP BARRIER
    276 
    277          CALL qminimum_p( q, nq, deltap )
     277c$OMP END DO NOWAIT
     278c$OMP BARRIER
     279
     280          CALL qminimum_p( q, nq, deltap )
     281         endif ! of if (planet_type.eq."earth")
    278282c
    279283c    .....  Calcul de la valeur moyenne, unique  aux poles pour  q .....
  • LMDZ4/branches/LMDZ4-dev/libf/dyn3dpar/leapfrog_p.F

    r1220 r1222  
    688688           jH_cur = jH_ref +                                            &
    689689     &              (itau * dtvr / daysec - int(itau * dtvr / daysec))
    690          call ju2ymds(jD_cur+jH_cur, an, mois, jour, secondes)
     690!         call ju2ymds(jD_cur+jH_cur, an, mois, jour, secondes)
    691691
    692692c rajout debug
     
    13931393
    13941394              if (planet_type.eq."earth") then
    1395 #ifdef CPP_EARTH
    13961395! Write an Earth-format restart file
    13971396                CALL dynredem1_p("restart.nc",0.0,
    13981397     &                           vcov,ucov,teta,q,masse,ps)
    1399 
    1400 #endif
    14011398              endif ! of if (planet_type.eq."earth")
    14021399
     
    15531550              IF(itau.EQ.itaufin) THEN
    15541551                if (planet_type.eq."earth") then
    1555 #ifdef CPP_EARTH
    15561552c$OMP MASTER
    15571553                   CALL dynredem1_p("restart.nc",0.0,
    15581554     .                               vcov,ucov,teta,q,masse,ps)
    15591555c$OMP END MASTER
    1560 #endif
    15611556                endif ! of if (planet_type.eq."earth")
    15621557              ENDIF ! of IF(itau.EQ.itaufin)
  • LMDZ4/branches/LMDZ4-dev/libf/dyn3dpar/limit_netcdf.F

    r1012 r1222  
    11!
    2 ! $Header$
     2! $Id$
    33!
    44C
    55C
    66      SUBROUTINE limit_netcdf(interbar, extrap, oldice, masque)
     7#ifdef CPP_EARTH
     8! This routine is designed to work for Earth
    79      USE dimphy
    810      use phys_state_var_mod , ONLY : pctsrf
     
    3335cy#include "dimphy.h"
    3436#include "indicesol.h"
     37#include "iniprint.h"
    3538c
    3639c-----------------------------------------------------------------------
     
    13231326      ierr = NF_CLOSE(nid)
    13241327c
     1328#else
     1329      WRITE(lunout,*)
     1330     & 'limit_netcdf: Earth-specific routine, needs Earth physics'
     1331#endif
     1332! of #ifdef CPP_EARTH
    13251333      STOP
    13261334      END
  • LMDZ4/branches/LMDZ4-dev/libf/dyn3dpar/mod_interface_dyn_phys.F90

    r792 r1222  
     1!
     2! $Id$
     3!
    14MODULE mod_interface_dyn_phys
    25  INTEGER,SAVE,dimension(:),allocatable :: index_i
     
    47 
    58 
     9#ifdef CPP_EARTH
     10! Interface with parallel physics,
     11! for now this routine only works with Earth physics
    612CONTAINS
    713 
     
    4955 
    5056  END SUBROUTINE Init_interface_dyn_phys
    51 
     57#endif
     58! of #ifdef CPP_EARTH
    5259END MODULE mod_interface_dyn_phys
  • LMDZ4/branches/LMDZ4-dev/libf/dyn3dpar/parallel.F90

    r1089 r1222  
     1!
     2! $Id$
     3!
    14  module parallel
    25  USE mod_const_mpi
     
    3336#include "dimensions.h"
    3437#include "paramet.h"
    35    
     38#include "iniprint.h"
     39
    3640      integer :: ierr
    3741      integer :: i,j
     
    8387        if (jj_nb_para(i) <= 2 ) then
    8488         
    85          print *,"Arret : le nombre de bande de lattitude par process est trop faible (<2)."
    86          print *," ---> diminuez le nombre de CPU ou augmentez la taille en lattitude"
     89         write(lunout,*)"Arret : le nombre de bande de lattitude par process est trop faible (<2)."
     90         write(lunout,*)" ---> diminuez le nombre de CPU ou augmentez la taille en lattitude"
    8791         
    8892#ifdef CPP_MPI
     
    127131      endif
    128132       
    129       print *,"jj_begin",jj_begin
    130       print *,"jj_end",jj_end
    131       print *,"ij_begin",ij_begin
    132       print *,"ij_end",ij_end
     133      write(lunout,*)"init_parallel: jj_begin",jj_begin
     134      write(lunout,*)"init_parallel: jj_end",jj_end
     135      write(lunout,*)"init_parallel: ij_begin",ij_begin
     136      write(lunout,*)"init_parallel: ij_end",ij_end
    133137
    134138!$OMP PARALLEL
     
    185189    use mod_prism_proto
    186190#endif
     191#ifdef CPP_EARTH
     192! Ehouarn: surface_data module is in 'phylmd' ...
    187193      use surface_data, only : type_ocean
    188194      implicit none
     195#else
     196      implicit none
     197! without the surface_data module, we declare (and set) a dummy 'type_ocean'
     198      character(len=6),parameter :: type_ocean="dummy"
     199#endif
     200! #endif of #ifdef CPP_EARTH
    189201
    190202      include "dimensions.h"
     
    415427    implicit none
    416428#include "dimensions.h"
    417 #include "paramet.h"   
     429#include "paramet.h"
     430#include "iniprint.h"
    418431#ifdef CPP_MPI
    419432    include 'mpif.h'
     
    436449           call Pack_Data(Field(ij_begin,1),ij,ll,min(jj_end,jjm)-jj_begin+1,Buffer_send)
    437450        else
    438            print *,ij 
     451           write(lunout,*)ij 
    439452        stop 'erreur dans Gather_Field'
    440453        endif
  • LMDZ4/branches/LMDZ4-dev/libf/dyn3dpar/startvar.F

    r1000 r1222  
    11!
    2 ! $Header$
     2! $Id$
    33!
    4 C
    5 C
    64      MODULE startvar
     5#ifdef CPP_EARTH
     6! This module is designed to work for Earth (and with ioipsl)
    77    !
    88    !
     
    11891189      END SUBROUTINE start_inter_3d
    11901190    !
     1191#endif
     1192! of #ifdef CPP_EARTH
    11911193      END MODULE startvar
Note: See TracChangeset for help on using the changeset viewer.