Changeset 65 for trunk


Ignore:
Timestamp:
01/02/13 18:50:00 (11 years ago)
Author:
smasson
Message:

bugfix for agrf, obc and xios

Location:
trunk/NEMOGCM/NEMO/OPA_SRC
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/NEMOGCM/NEMO/OPA_SRC/DYN/dynspg_flt.F90

    r63 r65  
    188188#if defined key_obc 
    189189      IF( lk_obc ) CALL obc_dyn( kt )   ! Update velocities on each open boundary with the radiation algorithm 
    190       IF( lk_obc) CALL obc_vol( kt )   ! Correction of the barotropic componant velocity to control the volume of the system 
     190      IF( lk_obc ) CALL obc_vol( kt )   ! Correction of the barotropic componant velocity to control the volume of the system 
    191191#endif 
    192192#if defined key_bdy 
     
    307307            ! multiplied by z2dt 
    308308#if defined key_obc 
     309IF(lk_obc) THEN 
    309310            ! caution : grad D = 0 along open boundaries 
    310311            ! Remark: The filtering force could be reduced here in the FRS zone 
     
    312313            spgu(ji,jj) = z2dt * ztdgu * obcumask(ji,jj) 
    313314            spgv(ji,jj) = z2dt * ztdgv * obcvmask(ji,jj) 
     315            ELSE 
     316               spgu(ji,jj) = z2dt * ztdgu 
     317               spgv(ji,jj) = z2dt * ztdgv 
     318            ENDIF 
    314319#elif defined key_bdy 
     320IF(lk_bdy) THEN 
    315321            ! caution : grad D = 0 along open boundaries 
    316322            spgu(ji,jj) = z2dt * ztdgu * bdyumask(ji,jj) 
    317323            spgv(ji,jj) = z2dt * ztdgv * bdyvmask(ji,jj) 
     324            ELSE 
     325               spgu(ji,jj) = z2dt * ztdgu 
     326               spgv(ji,jj) = z2dt * ztdgv 
     327            ENDIF 
    318328#else 
    319329            spgu(ji,jj) = z2dt * ztdgu 
  • trunk/NEMOGCM/NEMO/OPA_SRC/IOM/iom.F90

    r46 r65  
    8989      TYPE(xios_time) :: dtime    = xios_time(0, 0, 0, 0, 0, 0) 
    9090      CHARACTER(len=19) :: cldate  
    91       !!---------------------------------------------------------------------- 
    92  
    93       CALL xios_context_initialize("nemo", mpi_comm_opa) 
     91      CHARACTER(len=10) :: clname 
     92      !!---------------------------------------------------------------------- 
     93       
     94      clname = "nemo" 
     95      IF( TRIM(Agrif_CFixed()) /= '0' )   clname = TRIM(Agrif_CFixed())//"_"//TRIM(clname) 
     96      CALL xios_context_initialize(TRIM(clname), mpi_comm_opa) 
    9497      CALL iom_swap 
    9598 
    9699      ! calendar parameters 
    97100      SELECT CASE ( nleapy )        ! Choose calendar for IOIPSL 
    98       CASE ( 1)   ;   CALL xios_set_context_attr("nemo", calendar_type= "Gregorian") 
    99       CASE ( 0)   ;   CALL xios_set_context_attr("nemo", calendar_type= "NoLeap") 
    100       CASE (30)   ;   CALL xios_set_context_attr("nemo", calendar_type= "D360") 
     101      CASE ( 1)   ;   CALL xios_set_context_attr(TRIM(clname), calendar_type= "Gregorian") 
     102      CASE ( 0)   ;   CALL xios_set_context_attr(TRIM(clname), calendar_type= "NoLeap") 
     103      CASE (30)   ;   CALL xios_set_context_attr(TRIM(clname), calendar_type= "D360") 
    101104      END SELECT 
    102105      WRITE(cldate,"(i4.4,'-',i2.2,'-',i2.2,' 00:00:00')") nyear,nmonth,nday  
    103       CALL xios_set_context_attr("nemo", start_date=cldate ) 
     106      CALL xios_set_context_attr(TRIM(clname), start_date=cldate ) 
    104107 
    105108      ! horizontal grid definition 
     
    341344      INTEGER ::   i_s, i_e   ! temporary integer 
    342345      CHARACTER(LEN=100)    ::   clinfo    ! info character 
    343       INTEGER :: inb_period_initial, inb_period_final, inb_period_sec, inb_period_max, inb_period 
    344346      !--------------------------------------------------------------------- 
    345347      ! 
     
    351353         i_s = 1 
    352354         i_e = jpmax_files 
    353 #if defined key_iomput 
    354          CALL xios_context_finalize() 
    355 #endif 
    356355      ENDIF 
    357356 
  • trunk/NEMOGCM/NEMO/OPA_SRC/OBC/obcdta.F90

    r9 r65  
    1616   USE fldread         ! read input fields 
    1717   USE in_out_manager  ! I/O logical units 
     18   USE lib_mpp         ! for ctl_stop 
    1819 
    1920   IMPLICIT NONE 
     
    2324   PUBLIC obc_dta_bt   ! routines called by dynspg_ts.F90 
    2425 
    25    TYPE(FLD), DIMENSION(16) ::   sf_obc       !: structure:  
     26   TYPE(FLD), DIMENSION(:), ALLOCATABLE ::   sf_obc       !: structure:  
    2627   !!---------------------------------------------------------------------- 
    2728   !! NEMO/OPA 3.3 , NEMO Consortium (2010) 
     
    4041      !!--------------------------------------------------------------------- 
    4142      !       
     43      IF( lk_obc ) THEN 
     44 
    4245      IF( kt == nit000 )  CALL obc_dta_init() 
    4346      ! 
     
    7275         tfos(:,:) = sf_obc(15)%fnow(:,:,1) 
    7376         sfos(:,:) = sf_obc(16)%fnow(:,:,1) 
     77      ENDIF 
     78 
    7479      ENDIF 
    7580  
     
    111116      !! ** Action  : - read parameters 
    112117      !!--------------------------------------------------------------------------- 
    113       INTEGER :: ifpr 
     118      INTEGER :: ifpr,ierror 
    114119      CHARACTER(len=100) ::  cn_dir   !   Root directory for location of core files 
    115120      TYPE(FLD_N), DIMENSION(4) ::   sn_obce, sn_obcw, sn_obcn, sn_obcs  ! array of namelist informations on the obc to read 
    116121      NAMELIST/namobc_dta/ sn_obce, sn_obcw, sn_obcn, sn_obcs 
    117122      !!--------------------------------------------------------------------- 
     123      ALLOCATE(sf_obc(16), stat = ierror) 
     124      IF( ierror > 0 ) CALL ctl_stop('Pb of alloction of sf_obc(16) obc_dta_init') 
     125      ! 
    118126      ! set file information (default values) 
    119127      cn_dir = './'       ! directory in which the model is executed 
  • trunk/NEMOGCM/NEMO/OPA_SRC/SBC/cpl_oasis3.F90

    r37 r65  
    2525   !!   cpl_prism_finalize : finalize the coupled mode communication 
    2626   !!---------------------------------------------------------------------- 
     27#if defined key_oasis_mct 
     28   USE mod_prism 
     29#else 
    2730   USE mod_prism_proto              ! OASIS3 prism module 
    2831   USE mod_prism_def_partition_proto! OASIS3 prism module for partitioning 
     
    3033   USE mod_prism_get_proto          ! OASIS3 prism module for receiving 
    3134   USE mod_comprism_proto           ! OASIS3 prism module to get coupling frequency 
     35#endif 
    3236   USE par_oce                      ! ocean parameters 
    3337   USE dom_oce                      ! ocean space and time domain 
     
    5155   INTEGER                    ::   nerror            ! return error code 
    5256 
    53    INTEGER, PARAMETER ::   nmaxfld=40    ! Maximum number of coupling fields 
     57   INTEGER, PUBLIC, PARAMETER ::   nmaxfld=40    ! Maximum number of coupling fields 
    5458    
    5559   TYPE, PUBLIC ::   FLD_CPL               !: Type for coupling field information 
     
    6266   END TYPE FLD_CPL 
    6367 
    64    TYPE(FLD_CPL), DIMENSION(nmaxfld), PUBLIC ::   srcv, ssnd   !: Coupling fields 
     68   TYPE(FLD_CPL), DIMENSION(:), ALLOCATABLE, PUBLIC ::   srcv, ssnd   !: Coupling fields 
    6569 
    6670   REAL(wp), DIMENSION(:,:), ALLOCATABLE ::   exfld   ! Temporary buffer for receiving 
     
    8791      ! WARNING: No write in numout in this routine 
    8892      !============================================ 
    89  
    9093      !------------------------------------------------------------------ 
    9194      ! 1st Initialize the PRISM system for the application 
     
    194197                  zclname=srcv(ji)%clname 
    195198               ENDIF 
     199#if defined key_agrif 
     200               IF( agrif_fixed() /= 0 ) THEN  
     201                  zclname=TRIM(Agrif_CFixed())//zclname(2:8) 
     202               END IF 
     203#endif 
    196204               IF( ln_ctl ) WRITE(numout,*) "Define",ji,jc,zclname," for",PRISM_In 
    197205               CALL prism_def_var_proto ( srcv(ji)%nid(jc), zclname, id_part, (/ 2, 0/),   & 
     
    208216      ! End of definition phase 
    209217      !------------------------------------------------------------------ 
    210        
    211       CALL prism_enddef_proto(nerror) 
    212       IF( nerror /= PRISM_Ok )   CALL prism_abort_proto ( ncomp_id, 'cpl_prism_define', 'Failure in prism_enddef') 
    213       ! 
     218#if defined key_agrif 
     219!!$      IF( agrif_fixed() == agrif_nb_fixed_grids() ) THEN  
     220      IF( .NOT. Agrif_Root() ) THEN 
     221#endif 
     222         WRITE(numout,*) 'before prism_enddef_proto' 
     223         CALL FLUSH(numout) 
     224 
     225         CALL prism_enddef_proto(nerror) 
     226         IF( nerror /= PRISM_Ok )   CALL prism_abort_proto ( ncomp_id, 'cpl_prism_define', 'Failure in prism_enddef') 
     227      ! 
     228         WRITE(numout,*) 'after prism_enddef_proto' 
     229         CALL FLUSH(numout) 
     230#if defined key_agrif 
     231      ENDIF 
     232#endif 
     233 
    214234   END SUBROUTINE cpl_prism_define 
    215235    
     
    322342      INTEGER,INTENT(in) ::   kid   ! variable index  
    323343      !!---------------------------------------------------------------------- 
    324       cpl_prism_freq = ig_def_freq( kid ) 
     344!EM OASIS-MCT info not yet available on official distrib 
     345!      cpl_prism_freq = ig_def_freq( kid ) 
     346      cpl_prism_freq = 300 
    325347      ! 
    326348   END FUNCTION cpl_prism_freq 
  • trunk/NEMOGCM/NEMO/OPA_SRC/SBC/sbccpl.F90

    r43 r65  
    5858   IMPLICIT NONE 
    5959   PRIVATE 
    60  
     60!EM XIOS-OASIS-MCT compliance 
     61   PUBLIC   sbc_cpl_init       ! routine called by sbcmod.F90 
    6162   PUBLIC   sbc_cpl_rcv        ! routine called by sbc_ice_lim(_2).F90 
    6263   PUBLIC   sbc_cpl_snd        ! routine called by step.F90 
     
    221222      !! 
    222223      INTEGER ::   jn   ! dummy loop index 
     224      INTEGER ::   ierror  
    223225      REAL(wp), POINTER, DIMENSION(:,:) ::   zacs, zaos 
    224226      !! 
     
    231233      ! 
    232234      CALL wrk_alloc( jpi,jpj, zacs, zaos ) 
     235 
     236      ALLOCATE(srcv(nmaxfld), stat = ierror) 
     237      IF( nerror > 0 ) CALL ctl_stop('Pb of alloction of srcv(nmaxfld) in sbc_cpl_init') 
     238      ALLOCATE(ssnd(nmaxfld), stat = nerror) 
     239      IF( nerror > 0 ) CALL ctl_stop('Pb of alloction of ssnd(nmaxfld) in sbc_cpl_init') 
    233240 
    234241      ! ================================ ! 
     
    526533      ssnd(jps_tmix)%clname = 'O_TepMix' 
    527534      SELECT CASE( TRIM( sn_snd_temp%cldes ) ) 
     535      CASE( 'none'          )       ! nothing to do 
    528536      CASE( 'oce only'             )   ;   ssnd(   jps_toce             )%laction = .TRUE. 
    529537      CASE( 'weighted oce and ice' ) 
     
    693701      CALL wrk_alloc( jpi,jpj, ztx, zty ) 
    694702 
    695       IF( kt == nit000 )   CALL sbc_cpl_init( k_ice )          ! initialisation 
     703!EM XIOS/OASIS-MCT compliance 
     704!EM      IF( kt == nit000 )   CALL sbc_cpl_init( k_ice )          ! initialisation 
    696705 
    697706      !                                                 ! Receive all the atmos. fields (including ice information) 
  • trunk/NEMOGCM/NEMO/OPA_SRC/SBC/sbcmod.F90

    r46 r65  
    6363   !!---------------------------------------------------------------------- 
    6464   !! NEMO/OPA 4.0 , NEMO-consortium (2011)  
    65    !! $Id: sbcmod.F90 3415 2012-06-15 13:29:37Z rblod $ 
     65   !! $Id: sbcmod.F90 3294 2012-01-28 16:44:18Z rblod $ 
    6666   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt) 
    6767   !!---------------------------------------------------------------------- 
     
    200200 
    201201      IF( nn_ice == 4 )   CALL cice_sbc_init (nsbc) 
     202 
     203!EM modif XIOS/OASIS-MCT compliance 
     204      IF( nsbc == 5 )   CALL sbc_cpl_init (nn_ice) 
    202205      ! 
    203206   END SUBROUTINE sbc_init 
     
    240243      !                                            ! ---------------------------------------- ! 
    241244 
    242 !      CALL iom_setkt( kt + nn_fsbc - 1 )                 ! in sbc, iom_put is called every nn_fsbc time step 
     245!     CALL iom_setkt( kt + nn_fsbc - 1 )                 ! in sbc, iom_put is called every nn_fsbc time step 
    243246      ! 
    244247      IF( ln_apr_dyn ) CALL sbc_apr( kt )                ! atmospheric pressure provided at kt+0.5*nn_fsbc 
     
    343346      ENDIF 
    344347      ! 
    345 !      CALL iom_setkt( kt )           ! iom_put outside of sbc is called at every time step 
     348!     CALL iom_setkt( kt )           ! iom_put outside of sbc is called at every time step 
    346349      ! 
    347350      CALL iom_put( "utau", utau )   ! i-wind stress   (stress can be updated at  
  • trunk/NEMOGCM/NEMO/OPA_SRC/nemogcm.F90

    r46 r65  
    167167      !                            !------------------------! 
    168168      IF(lwp) WRITE(numout,cform_aaa)   ! Flag AAAAAAA 
     169      IF(lwp) Write(numout,*) 'Grid Number',Agrif_Fixed() 
     170      IF(lwp) WRITE(numout,cform_aaa)   ! Flag AAAAAAA 
    169171      ! 
    170172      IF( nstop /= 0 .AND. lwp ) THEN   ! error print 
     
    182184      ! 
    183185      CALL nemo_closefile 
    184 #if defined key_oasis3 || defined key_oasis4 
    185       CALL cpl_prism_finalize           ! end coupling and mpp communications with OASIS 
    186 #else 
    187186# if defined key_iomput 
    188187      IF( Agrif_Root() ) THEN 
    189          CALL xios_finalize             ! end mpp communications 
     188         CALL xios_finalize                ! end mpp communications 
    190189      ENDIF 
    191190# else 
    192191      IF( lk_mpp )   CALL mppstop       ! end mpp communications 
    193192# endif 
     193#if defined key_oasis3 || defined key_oasis4 
     194      IF( Agrif_Root() ) THEN 
     195         CALL cpl_prism_finalize           ! end coupling and mpp communications with OASIS 
     196      ENDIF 
    194197#endif 
    195198      ! 
     
    228231         CALL xios_initialize( "oceanx",local_comm=ilocal_comm ) 
    229232# else 
    230          CALL  xios_initialize( "nemo",return_comm=ilocal_comm ) 
     233         CALL xios_initialize( "nemo",return_comm=ilocal_comm ) 
    231234# endif 
    232235      ENDIF 
     
    326329      IF( lk_bdy        )   CALL     tide_init      ! Open boundaries initialisation of tidal harmonic forcing 
    327330 
    328                             CALL flush(numout) 
    329331                            CALL dyn_nept_init  ! simplified form of Neptune effect 
    330                             CALL flush(numout) 
    331332 
    332333                            CALL  istate_init   ! ocean initial state (Dynamics and tracers) 
     
    582583      ENDIF 
    583584      ! 
     585      IF( jpnj < jpni ) THEN  
     586         ji = jpni 
     587         jpni = jpnj 
     588         jpnj = ji 
     589      ENDIF 
     590      ! 
    584591      jpnij = jpni*jpnj 
    585592      ! 
  • trunk/NEMOGCM/NEMO/OPA_SRC/step.F90

    r46 r65  
    4040   PRIVATE 
    4141 
     42#if defined key_mpp_mpi 
     43   INCLUDE 'mpif.h' 
     44#endif 
    4245   PUBLIC   stp   ! called by opa.F90 
    4346 
     
    7881      INTEGER ::   indic    ! error indicator if < 0 
    7982       
    80       INTEGER :: inb_period_initial, inb_period_final, inb_period_sec, inb_period_max, inb_period 
     83      REAL(kind=wp)  ::   t_start 
    8184      !! --------------------------------------------------------------------- 
    8285 
    83       CALL SYSTEM_CLOCK(count_rate=inb_period_sec, count_max=inb_period_max) 
    84       CALL SYSTEM_CLOCK(count=inb_period_initial) 
     86#if defined key_mpp_mpi 
     87      t_start = MPI_Wtime() 
     88#endif 
    8589#if defined key_agrif 
    8690      kstp = nit000 + Agrif_Nb_Step() 
     
    270274      IF( nn_timing == 1 .AND.  kstp == nit000  )   CALL timing_reset 
    271275      ! 
    272       CALL SYSTEM_CLOCK(count=inb_period_final) 
    273       inb_period = inb_period_final - inb_period_initial 
    274       IF( inb_period_final < inb_period_initial ) inb_period = inb_period + inb_period_max 
    275       IF( lwp ) WRITE(numout,'(a, i6, f10.5)') 'step timing', kstp, REAL(inb_period,wp) / REAL(inb_period_sec,wp) 
     276#if defined key_mpp_mpi 
     277      IF( lwp ) WRITE(numout,'(a, i6, f10.5)') 'step timing ', kstp, MPI_WTIME() - t_start 
     278#endif 
     279      ! 
     280#if defined key_iomput 
     281      IF( kstp == nitend )   CALL xios_context_finalize() 
     282#endif 
    276283      ! 
    277284   END SUBROUTINE stp 
Note: See TracChangeset for help on using the changeset viewer.