Opened 5 years ago

Last modified 2 months ago

#1579 assigned Enhancement

Assumption initial conditions are on z-levels when ln_sco = .true.

Reported by: jamesharle Owned by: jamesharle
Priority: low Milestone:
Component: OCE Version: trunk
Severity: minor Keywords:
Cc:

Description

The initial conditions for runs ln_sco = .true. are assumed to be on z-levels based on gdept_1d. This is not immediately apparent from reading the manual.

A few options would be to either:

  • modify code such that depth information is required in the initial condition file. This would allow an initial condition file, comprising a different number of levels and/or gird type, to be read in and interpolated onto gdept_0.
  • remove the interpolation loop completely (bearing in mind the on-going simplification process) and impose that the initial conditions read in have to be on gdept_0, requiring a pre-processing step.

Commit History (0)

(No commits)

Change History (8)

comment:1 Changed 5 years ago by jamesharle

A fix I used a while back to get me going - could be tidied:

  • dtatsd.F90

     
    2222   USE lib_mpp         ! MPP library 
    2323   USE wrk_nemo        ! Memory allocation 
    2424   USE timing          ! Timing 
     25   USE in_out_manager 
     26   USE iom 
    2527 
    2628   IMPLICIT NONE 
    2729   PRIVATE 
     
    3335   LOGICAL , PUBLIC ::   ln_tsd_tradmp    !: internal damping toward input data flag 
    3436 
    3537   TYPE(FLD), ALLOCATABLE, DIMENSION(:) ::   sf_tsd   ! structure of input SST (file informations, fields read) 
     38#if defined key_gen_IC 
     39   REAL(wp), ALLOCATABLE, DIMENSION(:,:,: ) ::   gdept_init  
     40#endif 
    3641 
    3742   !! * Substitutions 
    3843#  include "domzgr_substitute.h90" 
     
    147152      ! 
    148153      INTEGER ::   ji, jj, jk, jl, jkk   ! dummy loop indicies 
    149154      INTEGER ::   ik, il0, il1, ii0, ii1, ij0, ij1   ! local integers 
     155#if defined key_gen_IC 
     156      INTEGER ::   id, jpk_init, jpk_initm1   ! local integers 
     157      INTEGER , DIMENSION(4)            ::   ddims 
     158#endif 
    150159      REAL(wp)::   zl, zi 
    151160      REAL(wp), POINTER, DIMENSION(:) ::  ztp, zsp   ! 1D workspace 
    152161      !!---------------------------------------------------------------------- 
     
    154163      IF( nn_timing == 1 )  CALL timing_start('dta_tsd') 
    155164      ! 
    156165      CALL fld_read( kt, 1, sf_tsd )      !==   read T & S data at kt time step   ==! 
     166 
     167#if defined key_gen_IC 
     168      CALL iom_open ( sf_tsd(jp_tem)%clname, sf_tsd(jp_tem)%num )  
     169      !! get dimensions 
     170      id = iom_varid( sf_tsd(jp_tem)%num, 'gdept', ddims ) 
     171      jpk_init = ddims(3) 
     172      IF(lwp) WRITE(numout,*) 'Dimensions of ICs: ', ddims, jpk_init 
     173      ALLOCATE( gdept_init(jpi,jpj,jpk_init) ) 
     174      CALL iom_get ( sf_tsd(jp_tem)%num, jpdom_data, 'gdept', gdept_init,1) 
     175      CALL iom_close( sf_tsd(jp_tem)%num )   ! Close the input file 
     176      jpk_initm1=jpk_init-1 
     177#endif 
    157178      ! 
    158179      ! 
    159180      !                                   !==   ORCA_R2 configuration and T & S damping   ==!  
     
    221242            DO ji = 1, jpi 
    222243               DO jk = 1, jpk                        ! determines the intepolated T-S profiles at each (i,j) points 
    223244                  zl = gdept_0(ji,jj,jk) 
     245#if defined key_gen_IC 
     246                  IF(     zl < gdept_init(ji,jj,1  ) ) THEN          ! above the first level of data 
     247#else 
    224248                  IF(     zl < gdept_1d(1  ) ) THEN          ! above the first level of data 
     249#endif 
    225250                     ztp(jk) =  ptsd(ji,jj,1    ,jp_tem) 
    226251                     zsp(jk) =  ptsd(ji,jj,1    ,jp_sal) 
     252#if defined key_gen_IC 
     253                  ELSEIF( zl > gdept_init(ji,jj,jpk_init) ) THEN          ! below the last level of data 
     254#else 
    227255                  ELSEIF( zl > gdept_1d(jpk) ) THEN          ! below the last level of data 
     256#endif 
    228257                     ztp(jk) =  ptsd(ji,jj,jpkm1,jp_tem) 
    229258                     zsp(jk) =  ptsd(ji,jj,jpkm1,jp_sal) 
    230259                  ELSE                                      ! inbetween : vertical interpolation between jkk & jkk+1 
     260#if defined key_gen_IC 
     261                     DO jkk = 1, jpk_initm1                                  ! when  gdept(jkk) < zl < gdept(jkk+1) 
     262                        IF( (zl-gdept_init(ji,jj,jkk)) * (zl-gdept_init(ji,jj,jkk+1)) <= 0._wp ) THEN 
     263                           zi = ( zl - gdept_init(ji,jj,jkk) ) / (gdept_init(ji,jj,jkk+1)-gdept_init(ji,jj,jkk)) 
     264#else 
    231265                     DO jkk = 1, jpkm1                                  ! when  gdept(jkk) < zl < gdept(jkk+1) 
    232266                        IF( (zl-gdept_1d(jkk)) * (zl-gdept_1d(jkk+1)) <= 0._wp ) THEN 
    233267                           zi = ( zl - gdept_1d(jkk) ) / (gdept_1d(jkk+1)-gdept_1d(jkk)) 
     268#endif 
    234269                           ztp(jk) = ptsd(ji,jj,jkk,jp_tem) + ( ptsd(ji,jj,jkk+1,jp_tem) - ptsd(ji,jj,jkk,jp_tem) ) * zi  
    235270                           zsp(jk) = ptsd(ji,jj,jkk,jp_sal) + ( ptsd(ji,jj,jkk+1,jp_sal) - ptsd(ji,jj,jkk,jp_sal) ) * zi 
    236271                        ENDIF 
     
    303338                                        DEALLOCATE( sf_tsd(jp_sal)%fnow )     ! S arrays in the structure 
    304339         IF( sf_tsd(jp_sal)%ln_tint )   DEALLOCATE( sf_tsd(jp_sal)%fdta ) 
    305340                                        DEALLOCATE( sf_tsd              )     ! the structure itself 
     341#if defined key_gen_IC 
     342         DEALLOCATE( gdept_init ) 
     343#endif 
    306344      ENDIF 
    307345      ! 
    308346      IF( nn_timing == 1 )  CALL timing_stop('dta_tsd') 
Last edited 2 years ago by nicolasmartin (previous) (diff)

comment:2 Changed 2 years ago by nicolasmartin

  • Owner nemo deleted
  • Status changed from new to assigned

comment:3 Changed 2 years ago by nicolasmartin

  • Severity set to minor
  • Type changed from Task to Enhancement

comment:4 Changed 2 years ago by jamesharle

I'm currently writing this code into my copy of the trunk. I was also thinking of removing this loop and putting it into domain_cfg TOOLS so the initial conditions are mapped onto the native vertical grid and written out when domain_cfg is used. That way they can be read in a runtime without the need for on-the-fly interpolation.

comment:5 Changed 23 months ago by nicolasmartin

  • Owner set to jamesharle

comment:6 Changed 2 months ago by smasson

  • Owner changed from jamesharle to mathiot

comment:7 Changed 2 months ago by mathiot

  • Owner changed from mathiot to jamesharle

James, one other solution could be to clarify the documentation and if you really want to to implement the capability and an action in the proposal for 2020 WP.

comment:8 Changed 2 months ago by jamesharle

  • Version changed from release-3.6 to trunk

OK - I have an updated changeset for v4.0 that I've been using for ORCHESTRA, so won't be too much effort to add. I'll look over the documentation and discuss with Andrew.

Note: See TracTickets for help on using tickets.