Skip to content

Commit

Permalink
apply fixes to branch that starts at git hash of Tido TCO319-DART ssp…
Browse files Browse the repository at this point in the history
…585 experiment
  • Loading branch information
ICCP Guest authored and ICCP Guest committed Oct 20, 2023
1 parent 602fd44 commit 0374b8c
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 8 deletions.
2 changes: 2 additions & 0 deletions src/gen_modules_clock.F90
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ module g_clock
integer :: ndpyr !number of days in yearnew
integer :: num_day_in_month(0:1,12)
character(4) :: cyearold, cyearnew !year as character string
character(2) :: cmonth !month as character string
data num_day_in_month(0,:) /31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31/
data num_day_in_month(1,:) /31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31/

Expand Down Expand Up @@ -55,6 +56,7 @@ subroutine clock
aux2=aux1+num_day_in_month(fleapyear,i)
if(daynew>aux1 .and. daynew<=aux2) then
month=i
write(cmonth, '(I2.2)') month
day_in_month=daynew-aux1
exit
end if
Expand Down
7 changes: 5 additions & 2 deletions src/gen_modules_diag.F90
Original file line number Diff line number Diff line change
Expand Up @@ -529,8 +529,11 @@ subroutine diag_densMOC(mode, mesh)

if (std_dens(is)>=dmax) is=ie
if (std_dens(ie)<=dmin) ie=is

uvdz_el=(UV(:,nz,elem)+fer_uv(:,nz,elem))*helem(nz,elem)
if (Fer_GM) then
uvdz_el=(UV(:,nz,elem)+fer_uv(:,nz,elem))*helem(nz,elem)
else
uvdz_el=UV(:,nz,elem)
end if
rhoz_el=(dens(nz)-dens(nz+1))/helem(nz,elem)
vol_el =helem(nz,elem)*elem_area(elem)
if (ie-is > 0) then
Expand Down
5 changes: 3 additions & 2 deletions src/gen_modules_partitioning.F90
Original file line number Diff line number Diff line change
Expand Up @@ -143,14 +143,15 @@ subroutine par_ex(abort) ! finalizes MPI
#endif
#if defined (__oifs)
!OIFS coupling doesnt call prism_terminate_proto and uses MPI_COMM_FESOM
use mod_oasis
implicit none
integer,optional :: abort
if (present(abort)) then
if (mype==0) write(*,*) 'Run finished unexpectedly!'
call MPI_ABORT( MPI_COMM_FESOM, 1 )
else
call MPI_Barrier(MPI_COMM_FESOM,MPIerr)
call MPI_Finalize(MPIerr)
if (mype==0) print *, 'FESOM calls oasis_terminate'
call oasis_terminate
endif
#endif

Expand Down
19 changes: 15 additions & 4 deletions src/io_meandata.F90
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ module io_MEANDATA
!--------------------------------------------------------------------------------------------
!
integer, save :: io_listsize=0
character(len=1), save :: filesplit_freq='y'
integer, save :: keep_nth_level

type io_entry
Expand Down Expand Up @@ -112,7 +113,7 @@ subroutine ini_mean_io(mesh)
character(len=10) :: id_string

type(t_mesh), intent(in) , target :: mesh
namelist /nml_listsize/ io_listsize
namelist /nml_listsize/ io_listsize, filesplit_freq
namelist /nml_list / io_list
namelist /nml_output_settings/ keep_nth_level

Expand Down Expand Up @@ -301,7 +302,11 @@ subroutine ini_mean_io(mesh)
CASE ('salt ')
call def_stream((/nl-1, nod2D/), (/nl-1, myDim_nod2D/), 'salt', 'salinity', 'psu', tr_arr(:,:,2), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, mesh)
CASE ('salt'//lvl_limit_name//' ')
call def_stream3D_lvl_limit((/lvl_limit, nod2D/), nl-1, (/lvl_limit, myDim_nod2D/), 'salt'//lvl_limit_name, 'salinity', 'psu', tr_arr(1:lvl_limit,:,2), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, mesh)
call def_stream3D_lvl_limit((/lvl_limit, nod2D/), nl-1, (/lvl_limit, myDim_nod2D/), 'salt'//lvl_limit_name, 'salinity', 'psu', tr_arr(1:lvl_limit,:,2), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, mesh)
CASE ('sigma0 ')
call def_stream((/nl-1, nod2D/), (/nl-1, myDim_nod2D/), 'sigma0', 'potential density', 'kg/m^3', density_m_rho0(:,:), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, mesh)
CASE ('sigma0'//lvl_limit_name//' ')
call def_stream3D_lvl_limit((/lvl_limit, nod2D/), nl-1, (/lvl_limit, myDim_nod2D/), 'sigma0'//lvl_limit_name, 'potential density', 'kg/m^3', density_m_rho0(1:lvl_limit,:), io_list(i)%freq, io_list(i)%unit, io_list(i)%precision, mesh)
CASE ('otracers ')
do j=3, num_tracers
write (id_string, "(I3.3)") tracer_id(j)
Expand Down Expand Up @@ -453,7 +458,7 @@ subroutine ini_mean_io(mesh)
call def_stream(elem2D, myDim_elem2D, 'u_bott', 'bottom velocity', 'm/s', u_bott(1:myDim_elem2D), 1, 'm', i_real4, mesh)
call def_stream(elem2D, myDim_elem2D, 'v_bott', 'bottom velocity', 'm/s', v_bott(1:myDim_elem2D), 1, 'm', i_real4, mesh)
call def_stream(elem2D, myDim_elem2D, 'u_surf', 'surface velocity', 'm/s', u_surf(1:myDim_elem2D), 1, 'm', i_real4, mesh)
call def_stream(elem2D, myDim_elem2D, 'v_surf', 'surface velocity', 'm/s', u_surf(1:myDim_elem2D), 1, 'm', i_real4, mesh)
call def_stream(elem2D, myDim_elem2D, 'v_surf', 'surface velocity', 'm/s', v_surf(1:myDim_elem2D), 1, 'm', i_real4, mesh)
call def_stream(elem2D, myDim_elem2D, 'tx_bot', 'bottom stress x', 'N/m2', stress_bott(1, 1:myDim_elem2D),1, 'm', i_real4, mesh)
call def_stream(elem2D, myDim_elem2D, 'ty_bot', 'bottom stress y', 'N/m2', stress_bott(2, 1:myDim_elem2D),1, 'm', i_real4, mesh)
if (sel_forcvar(11)==0) call def_stream(elem2D, myDim_elem2D, 'tx_sur', 'zonal wind stress to ocean', 'm/s2', stress_surf(1, 1:myDim_elem2D),1, 'm', i_real4, mesh) ; sel_forcvar(11)=1
Expand Down Expand Up @@ -933,7 +938,13 @@ subroutine output(istep, mesh)
if(entry%thread_running) call entry%thread%join()
entry%thread_running = .false.

filepath = trim(ResultPath)//trim(entry%name)//'.'//trim(runid)//'.'//cyearnew//'.nc'
if (filesplit_freq=='m') then

filepath = trim(ResultPath)//trim(entry%name)//'.'//trim(runid)//'.'//cyearnew//'_'//cmonth//'.nc'
else
filepath = trim(ResultPath)//trim(entry%name)//'.'//trim(runid)//'.'//cyearnew//'.nc'
endif

if(mype == entry%root_rank) then
if(filepath /= trim(entry%filename)) then
if("" /= trim(entry%filename)) call assert_nf(nf_close(entry%ncid), __LINE__)
Expand Down

0 comments on commit 0374b8c

Please sign in to comment.