Changeset 3471


Ignore:
Timestamp:
Mar 27, 2019, 2:35:38 PM (6 years ago)
Author:
yann meurdesoif
Message:

Unstructured case : adapt limit,nc to hadisst files with daily values instead of monthly for sst and sic.

YM

File:
1 edited

Legend:

Unmodified
Added
Removed
  • LMDZ6/trunk/libf/phylmd/create_limit_unstruct.F90

    r3469 r3471  
    66
    77CONTAINS
     8
    89
    910  SUBROUTINE create_limit_unstruct
     
    1819  IMPLICIT NONE
    1920    INCLUDE "iniprint.h"
    20     REAL,    DIMENSION(klon,lmdep)                 :: sic
    21     REAL,    DIMENSION(klon,lmdep)                 :: sst
     21    REAL,    DIMENSION(:,:),ALLOCATABLE            :: sic
     22    REAL,    DIMENSION(:,:),ALLOCATABLE            :: sst
    2223    REAL,    DIMENSION(klon,lmdep)                 :: rugos
    2324    REAL,    DIMENSION(klon,lmdep)                 :: albedo
    24     REAL,    DIMENSION(klon_mpi,lmdep)             :: sic_mpi
    25     REAL,    DIMENSION(klon_mpi,lmdep)             :: sst_mpi
     25    REAL,    DIMENSION(:,:),ALLOCATABLE            :: sic_mpi
     26    REAL,    DIMENSION(:,:),ALLOCATABLE            :: sst_mpi
    2627    REAL,    DIMENSION(klon_mpi,lmdep)             :: rugos_mpi
    2728    REAL,    DIMENSION(klon_mpi,lmdep)             :: albedo_mpi
     
    4142    INTEGER :: l,k
    4243    INTEGER :: nbad
    43    
     44    INTEGER :: sic_time_axis_size
     45    INTEGER :: sst_time_axis_size
     46    CHARACTER(LEN=99)                  :: mess            ! error message
     47   
     48     
    4449    ndays=ioget_year_len(annee_ref)
     50   
     51    IF (is_omp_master) CALL xios_get_axis_attr("time_sic",n_glo=sic_time_axis_size)
     52    CALL bcast_omp(sic_time_axis_size)
     53    ALLOCATE(sic_mpi(klon_mpi,sic_time_axis_size))
     54    ALLOCATE(sic(klon,sic_time_axis_size))
     55   
     56   
     57    IF (is_omp_master) CALL xios_get_axis_attr("time_sst",n_glo=sst_time_axis_size)
     58    CALL bcast_omp(sst_time_axis_size)
     59    ALLOCATE(sst_mpi(klon_mpi,sst_time_axis_size))
     60    ALLOCATE(sst(klon,sst_time_axis_size))
    4561   
    4662    IF (is_omp_master) THEN
     
    6278    ALLOCATE(phy_bil(klon,ndays)); phy_bil=0.0
    6379
     80
    6481! sic
    65     CALL time_interpolation(ndays,sic,'gregorian',sic_year)
     82    IF (sic_time_axis_size==lmdep) THEN
     83      CALL time_interpolation(ndays,sic,'gregorian',sic_year)
     84    ELSE IF (sic_time_axis_size==ndays) THEN
     85      sic_year=sic
     86    ELSE
     87      WRITE(mess,*) 'sic time axis is nor montly, nor daily. sic time interpolation ',&
     88                    'is requiered but is not currently managed'
     89      CALL abort_physic('create_limit_unstruct',TRIM(mess),1)
     90    ENDIF
     91   
    6692    sic_year(:,:)=sic_year(:,:)/100.  ! convert percent to fraction
    6793    WHERE(sic_year(:,:)>1.0) sic_year(:,:)=1.0    ! Some fractions have some time large negative values
     
    6995   
    7096! sst
    71     CALL time_interpolation(ndays,sst,'gregorian',sst_year)
     97    IF (sst_time_axis_size==lmdep) THEN
     98      CALL time_interpolation(ndays,sst,'gregorian',sst_year)
     99    ELSE IF (sst_time_axis_size==ndays) THEN
     100      sst_year=sst
     101    ELSE
     102      WRITE(mess,*)'sic time axis is nor montly, nor daily. sic time interpolation ',&
     103                   'is requiered but is not currently managed'
     104      CALL abort_physic('create_limit_unstruct',TRIM(mess),1)
     105    ENDIF
    72106    WHERE(sst_year(:,:)<271.38) sst_year(:,:)=271.38
     107
    73108
    74109! rugos   
Note: See TracChangeset for help on using the changeset viewer.