Ignore:
Timestamp:
Jan 25, 2016, 10:18:35 AM (9 years ago)
Author:
ymipsl
Message:
  • Initial state from file in dynamico can be properly generated by switching flag in run_icosa.def
  • bug fix for openMP when generate initial state from file

YM

Location:
dynamico_lmdz/aquaplanet/ICOSAGCM/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • dynamico_lmdz/aquaplanet/ICOSAGCM/src/etat0.f90

    r3862 r3887  
    88    REAL(rstd) :: etat0_temp
    99
    10     PUBLIC :: etat0, etat0_type
     10    PUBLIC :: etat0, init_etat0, etat0_type
    1111
    1212CONTAINS
     13
     14  SUBROUTINE Init_etat0
     15  USE etat0_database_mod
     16  IMPLICIT NONE
     17
     18    CALL getin("etat0",etat0_type)
     19
     20    SELECT CASE (TRIM(etat0_type))
     21      CASE ('isothermal')
     22      CASE ('temperature_profile')
     23      CASE ('jablonowsky06')
     24      CASE ('dcmip5')
     25      CASE ('williamson91.6')
     26      CASE ('start_file')
     27      CASE ('database')
     28        CALL init_etat0_database
     29      CASE ('academic')
     30      CASE ('held_suarez')
     31      CASE ('venus')
     32      CASE ('dcmip1')
     33      CASE ('dcmip2_mountain','dcmip2_schaer_noshear','dcmip2_schaer_shear')
     34      CASE ('dcmip3')
     35      CASE ('dcmip4')
     36      CASE DEFAULT
     37         PRINT*, 'Bad selector for variable etat0 <',etat0_type, &
     38            '> options are <jablonowsky06>, <academic>, <dcmip[1-4]> '
     39         STOP
     40    END SELECT
     41 
     42  END SUBROUTINE Init_etat0
    1343 
    1444  SUBROUTINE etat0(f_ps,f_mass,f_phis,f_theta_rhodz,f_u, f_q)
  • dynamico_lmdz/aquaplanet/ICOSAGCM/src/etat0_database.f90

    r3862 r3887  
    33
    44CONTAINS
     5
     6  SUBROUTINE init_etat0_database
     7  USE xios
     8  IMPLICIT NONE
     9 
     10    CALL xios_set_fieldgroup_attr("read_fields",enabled=.TRUE.)
     11    CALL xios_set_filegroup_attr("read_files",enabled=.TRUE.)
     12
     13  END SUBROUTINE init_etat0_database
    514
    615  SUBROUTINE etat0(f_ps,f_phis,f_theta_rhodz,f_u, f_q)
     
    1827  USE pression_mod
    1928  USE write_etat0_mod
     29  USE omp_para
    2030  IMPLICIT NONE
    2131    TYPE(t_field),POINTER :: f_ps(:)
     
    2535    TYPE(t_field),POINTER :: f_q(:)
    2636
    27     TYPE(t_field),POINTER :: f_ulon_reg(:)
    28     TYPE(t_field),POINTER :: f_ulat_reg(:)
    29     TYPE(t_field),POINTER :: f_temp_reg(:)
    30     TYPE(t_field),POINTER :: f_q_reg(:)
     37    TYPE(t_field),POINTER,SAVE :: f_ulon_reg(:)
     38    TYPE(t_field),POINTER,SAVE :: f_ulat_reg(:)
     39    TYPE(t_field),POINTER,SAVE :: f_temp_reg(:)
     40    TYPE(t_field),POINTER,SAVE :: f_q_reg(:)
    3141
    32     TYPE(t_field),POINTER :: f_ts(:)
    33     TYPE(t_field),POINTER :: f_z(:)
    34     TYPE(t_field),POINTER :: f_ulon(:)
    35     TYPE(t_field),POINTER :: f_ulat(:)
    36     TYPE(t_field),POINTER :: f_temp(:)
    37     TYPE(t_field),POINTER :: f_q1(:)
    38     TYPE(t_field),POINTER :: f_qsat(:)
    39     TYPE(t_field),POINTER :: f_p(:)
     42    TYPE(t_field),POINTER,SAVE :: f_ts(:)
     43    TYPE(t_field),POINTER,SAVE :: f_z(:)
     44    TYPE(t_field),POINTER,SAVE :: f_ulon(:)
     45    TYPE(t_field),POINTER,SAVE :: f_ulat(:)
     46    TYPE(t_field),POINTER,SAVE :: f_temp(:)
     47    TYPE(t_field),POINTER,SAVE :: f_q1(:)
     48    TYPE(t_field),POINTER,SAVE :: f_qsat(:)
     49    TYPE(t_field),POINTER,SAVE :: f_p(:)
    4050    INTEGER :: nb_level
    4151    REAL,ALLOCATABLE:: levels(:)
     
    4353
    4454    CALL xios_read_field("relief",f_phis)
     55   
    4556    CALL writeField("relief_out",f_phis,once=.TRUE.)
     57
    4658    DO ind=1,ndomain
    4759      IF (.NOT. assigned_domain(ind)) CYCLE
     
    5062
    5163
    52     CALL xios_get_axis_attr("lev_ecdyn",n_glo=nb_level)
     64    IF (is_omp_master) CALL xios_get_axis_attr("lev_ecdyn",n_glo=nb_level)
     65    CALL bcast_omp(nb_level)
    5366    ALLOCATE(levels(nb_level))
    54     CALL xios_get_axis_attr("lev_ecdyn",value=levels)
     67
     68    IF (is_omp_master) CALL xios_get_axis_attr("lev_ecdyn",value=levels)
     69    CALL bcast_omp(levels)
     70   
    5571    levels=levels*100  ! hectoPascal -> Pascal
    5672 
     
    7389    CALL xios_read_field("ts",f_ts)
    7490    CALL writeField("ps_out",f_ps)
     91
     92!$OMP BARRIER
     93   
    7594!    CALL writeField("phis_out",f_phis,once=.TRUE.)
    7695!    CALL writeField("ts_out",f_ts,once=.TRUE.)
     
    124143    CALL writeField("f_q",f_q,once=.TRUE.)
    125144    CALL write_etat0(0,f_ps,f_phis,f_theta_rhodz,f_u, f_q)
    126        
     145   
     146
     147
     148    CALL deallocate_field(f_ts)
     149    CALL deallocate_field(f_z)
     150    CALL deallocate_field(f_ulon_reg)
     151    CALL deallocate_field(f_ulat_reg)
     152    CALL deallocate_field(f_temp_reg)
     153    CALL deallocate_field(f_q_reg)
     154   
     155    CALL deallocate_field(f_q1)
     156    CALL deallocate_field(f_qsat)
     157    CALL deallocate_field(f_p)
     158    CALL deallocate_field(f_temp)
     159    CALL deallocate_field(f_ulon)
     160    CALL deallocate_field(f_ulat)   
     161 
    127162  END SUBROUTINE etat0
    128163
  • dynamico_lmdz/aquaplanet/ICOSAGCM/src/icosagcm.f90

    r3845 r3887  
    3030    CALL compute_domain
    3131    CALL init_transfert
     32    CALL init_etat0
    3233    CALL init_writefield
    3334    CALL init_trace
Note: See TracChangeset for help on using the changeset viewer.