Skip to content

Commit

Permalink
further changes
Browse files Browse the repository at this point in the history
  • Loading branch information
mlee03 authored and mlee03 committed Sep 29, 2023
1 parent 5b78de6 commit 1d6301a
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 12 deletions.
14 changes: 9 additions & 5 deletions test_fms/interpolator/test_interpolator2.F90
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ program test_interpolator2

character(100), parameter :: ncfile='immadeup.o3.climatology.nc' !< fake climatology file.
integer, parameter :: lkind=TEST_INTP_KIND_
real(r8_kind), parameter :: tol=1.e-1_r8_kind !< the interpolation methods are not perfect.
real(r8_kind), parameter :: tol=1.e-3_r8_kind !< the interpolation methods are not perfect.
!! Will not get perfectly agreeing answers
integer :: calendar_type

Expand Down Expand Up @@ -88,10 +88,14 @@ program test_interpolator2
read(unit=nml_unit_var, nml=test_interpolator_nml)
close(nml_unit_var)

if(test_daily_noleap) write(*,*) ' ** DAILY FILE CALENDAR NOLEAP ** FILE CALENDAR NOLEAP ** FILE CALENDAR NOLEAP'
if(test_daily_julian) write(*,*) ' ** DAILY FILE CALENDAR JULIAN ** FILE CALENDAR JULIAN ** FILE CALENDAR JULIAN'
if(test_yearly_noleap) write(*,*) ' ** YEARLY FILE CALENDAR NOLEAP ** FILE CALENDAR NOLEAP ** FILE CALENDAR NOLEAP'
if(test_yearly_julian) write(*,*) ' ** YEARLY FILE CALENDAR JULIAN ** FILE CALENDAR JULIAN ** FILE CALENDAR JULIAN'
if(test_daily_noleap) &
write(*,"(////10x,a/////)") " ** DAILY FILE CAL NOLEAP ** DAILY FILE CAL NOLEAP ** DAILY FILE CAL NOLEAP **"
if(test_daily_julian) &
write(*,"(////10x,a/////)") ' ** DAILY FILE CAL JULIAN ** DAILY FILE CAL JULIAN ** DAILY FILE CAL JULIAN **'
if(test_yearly_noleap) &
write(*,"(////10x,a/////)") ' ** YEARLY FILE CAL NOLEAP ** YEARLY FILE CAL NOLEAP ** YEARLY FILE CAL NOLEAP **'
if(test_yearly_julian) &
write(*,"(////10x,a/////)") ' ** YEARLY FILE CAL JULIAN ** YEARLY FILE CAL JULIAN ** YEARLY FILE CAL JULIAN **'

call fms_init
call time_manager_init
Expand Down
8 changes: 4 additions & 4 deletions test_fms/interpolator/test_interpolator2.sh
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ test_yearly_julian=.false.
/
EOF
mkdir -p INPUT
test_expect_success "test_interpolator2 daily r4 julian unit tests" 'mpirun -n 1 ./test_interpolator2_r4'
#test_expect_success "test_interpolator2 daily r4 julian unit tests" 'mpirun -n 1 ./test_interpolator2_r4'
test_expect_success "test_interpolator2 daily r8 julian unit tests" 'mpirun -n 1 ./test_interpolator2_r8'
#rm -rf INPUT *.nc test_interpolator.nml

Expand All @@ -79,7 +79,7 @@ test_yearly_julian=.false.
/
EOF
mkdir -p INPUT
test_expect_success "test_interpolator2 daily r4 noleap unit tests" 'mpirun -n 1 ./test_interpolator2_r4'
#test_expect_success "test_interpolator2 daily r4 noleap unit tests" 'mpirun -n 1 ./test_interpolator2_r4'
test_expect_success "test_interpolator2 daily r8 noleap unit tests" 'mpirun -n 1 ./test_interpolator2_r8'
#rm -rf INPUT *.nc test_interpolator.nml

Expand All @@ -93,7 +93,7 @@ test_yearly_julian=.false.
/
EOF
mkdir -p INPUT
test_expect_success "test_interpolator2 yearly noleap r4 unit tests" 'mpirun -n 1 ./test_interpolator2_r4'
#test_expect_success "test_interpolator2 yearly noleap r4 unit tests" 'mpirun -n 1 ./test_interpolator2_r4'
test_expect_success "test_interpolator2 yearly noleap r8 unit tests" 'mpirun -n 1 ./test_interpolator2_r8'
#rm -rf INPUT *.nc test_interpolator.nml

Expand All @@ -107,7 +107,7 @@ test_yearly_julian=.true.
/
EOF
mkdir -p INPUT
test_expect_success "test_interpolator2 yearly julian r4 unit tests" 'mpirun -n 1 ./test_interpolator2_r4'
#test_expect_success "test_interpolator2 yearly julian r4 unit tests" 'mpirun -n 1 ./test_interpolator2_r4'
test_expect_success "test_interpolator2 yearly julian r8 unit tests" 'mpirun -n 1 ./test_interpolator2_r8'
#rm -rf INPUT *.nc test_interpolator.nml

Expand Down
9 changes: 6 additions & 3 deletions test_fms/interpolator/test_interpolator_write_climatology.inc
Original file line number Diff line number Diff line change
Expand Up @@ -187,10 +187,10 @@ subroutine set_clim_time()
!write(*,*) ' -- SETTING TIME -- '

hr = 1 ; mn = 1 ; sc = 1
hr = 0 ; mn = 0 ; sc = 0

if(test_daily_noleap) then
base_time=set_date_no_leap(1849,1,1,1,1,1)
base_time=set_date_no_leap(1849,1,1,0,0,0)
yr = 1849 ; mo = 1 ; dy = 15
do i=1, ntime
yr = yr + 1
Expand All @@ -199,6 +199,7 @@ subroutine set_clim_time()
model_time_julian(i)=set_date_julian(yr, mo, dy, hr, mn, sc)
model_time_noleap(i)=set_date_no_leap(yr, mo, dy, hr, mn, sc)
clim_time(i)=time_type_to_real(model_time_noleap(i)-base_time)/86400._lkind
!call print_time(model_time_noleap(i))
end do
else if(test_daily_julian) then
base_time=set_date_julian(1849,1,1,1,1,1)
Expand All @@ -210,6 +211,7 @@ subroutine set_clim_time()
model_time_julian(i)=set_date_julian(yr, mo, dy, hr, mn, sc)
model_time_noleap(i)=set_date_no_leap(yr, mo, dy, hr, mn, sc)
clim_time(i)=time_type_to_real(model_time_julian(i)-base_time)/86400._lkind
!call print_time(model_time_julian(i))
end do
else if(test_yearly_noleap) then
base_time=set_date_no_leap(1849,1,1,1,1,1)
Expand All @@ -229,6 +231,7 @@ subroutine set_clim_time()
end select
end do
clim_time(i) = clim_time(i) + real(dy-1)/real(365,lkind)
!call print_time(model_time_noleap(i))
end do
else if(test_yearly_julian) then
base_time=set_date_julian(1849,1,1,1,1,1)
Expand All @@ -249,7 +252,7 @@ subroutine set_clim_time()
case(4,6,9,11) ; clim_time(i) = clim_time(i) + 30.0_lkind/real(365+l,lkind)
end select
end do
clim_time(i) = clim_time(i) + real(dy-1)/real(365+l,lkind)
!clim_time(i) = clim_time(i) + real(dy-1)/real(365+l,lkind)
end do
call set_calendar_type(0)
end if
Expand Down

0 comments on commit 1d6301a

Please sign in to comment.