Skip to content

Commit

Permalink
Updating write init files from python file update.
Browse files Browse the repository at this point in the history
  • Loading branch information
mwaxmonsky committed Jul 25, 2023
1 parent f1ec6b1 commit 3f400ec
Show file tree
Hide file tree
Showing 13 changed files with 104 additions and 26 deletions.
10 changes: 8 additions & 2 deletions test/unit/sample_files/write_init_files/physics_inputs_4D.F90
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ subroutine physics_read_data(file, suite_names, timestep, read_initialized_varia
type(ccpp_constituent_prop_ptr_t), pointer :: const_props(:)
real(kind=kind_phys) :: constituent_default_value
integer :: constituent_errflg
character(len=SHR_KIND_CX) :: constituent_errmsg
character(len=512) :: constituent_errmsg
logical :: constituent_has_default

! Logical to default optional argument to False:
Expand Down Expand Up @@ -153,14 +153,20 @@ subroutine physics_read_data(file, suite_names, timestep, read_initialized_varia
constituent_has_default = .false.
call const_props(constituent_idx)%has_default(constituent_has_default, &
constituent_errflg, constituent_errmsg)
if (constituent_errflg .ne. 0) then
call endrun(constituent_errmsg)
end if
if (constituent_has_default) then
call &
const_props(constituent_idx)%default_value(constituent_default_value, constituent_errflg,&
constituent_errmsg)
if (constituent_errflg .ne. 0) then
call endrun(constituent_errmsg)
end if
field_data_ptr(:,:,constituent_idx) = constituent_default_value
if (masterproc) then
write(iulog,*) 'Consitituent ', ccpp_required_data(req_idx), &
' initialized from file: ', constituent_default_value
' initialized to default value: ', constituent_default_value
end if
else
field_data_ptr(:,:,constituent_idx) = 0._kind_phys
Expand Down
10 changes: 8 additions & 2 deletions test/unit/sample_files/write_init_files/physics_inputs_bvd.F90
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ subroutine physics_read_data(file, suite_names, timestep, read_initialized_varia
type(ccpp_constituent_prop_ptr_t), pointer :: const_props(:)
real(kind=kind_phys) :: constituent_default_value
integer :: constituent_errflg
character(len=SHR_KIND_CX) :: constituent_errmsg
character(len=512) :: constituent_errmsg
logical :: constituent_has_default

! Logical to default optional argument to False:
Expand Down Expand Up @@ -153,14 +153,20 @@ subroutine physics_read_data(file, suite_names, timestep, read_initialized_varia
constituent_has_default = .false.
call const_props(constituent_idx)%has_default(constituent_has_default, &
constituent_errflg, constituent_errmsg)
if (constituent_errflg .ne. 0) then
call endrun(constituent_errmsg)
end if
if (constituent_has_default) then
call &
const_props(constituent_idx)%default_value(constituent_default_value, constituent_errflg,&
constituent_errmsg)
if (constituent_errflg .ne. 0) then
call endrun(constituent_errmsg)
end if
field_data_ptr(:,:,constituent_idx) = constituent_default_value
if (masterproc) then
write(iulog,*) 'Consitituent ', ccpp_required_data(req_idx), &
' initialized from file: ', constituent_default_value
' initialized to default value: ', constituent_default_value
end if
else
field_data_ptr(:,:,constituent_idx) = 0._kind_phys
Expand Down
10 changes: 8 additions & 2 deletions test/unit/sample_files/write_init_files/physics_inputs_ddt.F90
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ subroutine physics_read_data(file, suite_names, timestep, read_initialized_varia
type(ccpp_constituent_prop_ptr_t), pointer :: const_props(:)
real(kind=kind_phys) :: constituent_default_value
integer :: constituent_errflg
character(len=SHR_KIND_CX) :: constituent_errmsg
character(len=512) :: constituent_errmsg
logical :: constituent_has_default

! Logical to default optional argument to False:
Expand Down Expand Up @@ -153,14 +153,20 @@ subroutine physics_read_data(file, suite_names, timestep, read_initialized_varia
constituent_has_default = .false.
call const_props(constituent_idx)%has_default(constituent_has_default, &
constituent_errflg, constituent_errmsg)
if (constituent_errflg .ne. 0) then
call endrun(constituent_errmsg)
end if
if (constituent_has_default) then
call &
const_props(constituent_idx)%default_value(constituent_default_value, constituent_errflg,&
constituent_errmsg)
if (constituent_errflg .ne. 0) then
call endrun(constituent_errmsg)
end if
field_data_ptr(:,:,constituent_idx) = constituent_default_value
if (masterproc) then
write(iulog,*) 'Consitituent ', ccpp_required_data(req_idx), &
' initialized from file: ', constituent_default_value
' initialized to default value: ', constituent_default_value
end if
else
field_data_ptr(:,:,constituent_idx) = 0._kind_phys
Expand Down
10 changes: 8 additions & 2 deletions test/unit/sample_files/write_init_files/physics_inputs_ddt2.F90
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ subroutine physics_read_data(file, suite_names, timestep, read_initialized_varia
type(ccpp_constituent_prop_ptr_t), pointer :: const_props(:)
real(kind=kind_phys) :: constituent_default_value
integer :: constituent_errflg
character(len=SHR_KIND_CX) :: constituent_errmsg
character(len=512) :: constituent_errmsg
logical :: constituent_has_default

! Logical to default optional argument to False:
Expand Down Expand Up @@ -153,14 +153,20 @@ subroutine physics_read_data(file, suite_names, timestep, read_initialized_varia
constituent_has_default = .false.
call const_props(constituent_idx)%has_default(constituent_has_default, &
constituent_errflg, constituent_errmsg)
if (constituent_errflg .ne. 0) then
call endrun(constituent_errmsg)
end if
if (constituent_has_default) then
call &
const_props(constituent_idx)%default_value(constituent_default_value, constituent_errflg,&
constituent_errmsg)
if (constituent_errflg .ne. 0) then
call endrun(constituent_errmsg)
end if
field_data_ptr(:,:,constituent_idx) = constituent_default_value
if (masterproc) then
write(iulog,*) 'Consitituent ', ccpp_required_data(req_idx), &
' initialized from file: ', constituent_default_value
' initialized to default value: ', constituent_default_value
end if
else
field_data_ptr(:,:,constituent_idx) = 0._kind_phys
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ subroutine physics_read_data(file, suite_names, timestep, read_initialized_varia
type(ccpp_constituent_prop_ptr_t), pointer :: const_props(:)
real(kind=kind_phys) :: constituent_default_value
integer :: constituent_errflg
character(len=SHR_KIND_CX) :: constituent_errmsg
character(len=512) :: constituent_errmsg
logical :: constituent_has_default

! Logical to default optional argument to False:
Expand Down Expand Up @@ -154,14 +154,20 @@ subroutine physics_read_data(file, suite_names, timestep, read_initialized_varia
constituent_has_default = .false.
call const_props(constituent_idx)%has_default(constituent_has_default, &
constituent_errflg, constituent_errmsg)
if (constituent_errflg .ne. 0) then
call endrun(constituent_errmsg)
end if
if (constituent_has_default) then
call &
const_props(constituent_idx)%default_value(constituent_default_value, constituent_errflg,&
constituent_errmsg)
if (constituent_errflg .ne. 0) then
call endrun(constituent_errmsg)
end if
field_data_ptr(:,:,constituent_idx) = constituent_default_value
if (masterproc) then
write(iulog,*) 'Consitituent ', ccpp_required_data(req_idx), &
' initialized from file: ', constituent_default_value
' initialized to default value: ', constituent_default_value
end if
else
field_data_ptr(:,:,constituent_idx) = 0._kind_phys
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ subroutine physics_read_data(file, suite_names, timestep, read_initialized_varia
type(ccpp_constituent_prop_ptr_t), pointer :: const_props(:)
real(kind=kind_phys) :: constituent_default_value
integer :: constituent_errflg
character(len=SHR_KIND_CX) :: constituent_errmsg
character(len=512) :: constituent_errmsg
logical :: constituent_has_default

! Logical to default optional argument to False:
Expand Down Expand Up @@ -153,14 +153,20 @@ subroutine physics_read_data(file, suite_names, timestep, read_initialized_varia
constituent_has_default = .false.
call const_props(constituent_idx)%has_default(constituent_has_default, &
constituent_errflg, constituent_errmsg)
if (constituent_errflg .ne. 0) then
call endrun(constituent_errmsg)
end if
if (constituent_has_default) then
call &
const_props(constituent_idx)%default_value(constituent_default_value, constituent_errflg,&
constituent_errmsg)
if (constituent_errflg .ne. 0) then
call endrun(constituent_errmsg)
end if
field_data_ptr(:,:,constituent_idx) = constituent_default_value
if (masterproc) then
write(iulog,*) 'Consitituent ', ccpp_required_data(req_idx), &
' initialized from file: ', constituent_default_value
' initialized to default value: ', constituent_default_value
end if
else
field_data_ptr(:,:,constituent_idx) = 0._kind_phys
Expand Down
10 changes: 8 additions & 2 deletions test/unit/sample_files/write_init_files/physics_inputs_mf.F90
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ subroutine physics_read_data(file, suite_names, timestep, read_initialized_varia
type(ccpp_constituent_prop_ptr_t), pointer :: const_props(:)
real(kind=kind_phys) :: constituent_default_value
integer :: constituent_errflg
character(len=SHR_KIND_CX) :: constituent_errmsg
character(len=512) :: constituent_errmsg
logical :: constituent_has_default

! Logical to default optional argument to False:
Expand Down Expand Up @@ -154,14 +154,20 @@ subroutine physics_read_data(file, suite_names, timestep, read_initialized_varia
constituent_has_default = .false.
call const_props(constituent_idx)%has_default(constituent_has_default, &
constituent_errflg, constituent_errmsg)
if (constituent_errflg .ne. 0) then
call endrun(constituent_errmsg)
end if
if (constituent_has_default) then
call &
const_props(constituent_idx)%default_value(constituent_default_value, constituent_errflg,&
constituent_errmsg)
if (constituent_errflg .ne. 0) then
call endrun(constituent_errmsg)
end if
field_data_ptr(:,:,constituent_idx) = constituent_default_value
if (masterproc) then
write(iulog,*) 'Consitituent ', ccpp_required_data(req_idx), &
' initialized from file: ', constituent_default_value
' initialized to default value: ', constituent_default_value
end if
else
field_data_ptr(:,:,constituent_idx) = 0._kind_phys
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ subroutine physics_read_data(file, suite_names, timestep, read_initialized_varia
type(ccpp_constituent_prop_ptr_t), pointer :: const_props(:)
real(kind=kind_phys) :: constituent_default_value
integer :: constituent_errflg
character(len=SHR_KIND_CX) :: constituent_errmsg
character(len=512) :: constituent_errmsg
logical :: constituent_has_default

! Logical to default optional argument to False:
Expand Down Expand Up @@ -153,14 +153,20 @@ subroutine physics_read_data(file, suite_names, timestep, read_initialized_varia
constituent_has_default = .false.
call const_props(constituent_idx)%has_default(constituent_has_default, &
constituent_errflg, constituent_errmsg)
if (constituent_errflg .ne. 0) then
call endrun(constituent_errmsg)
end if
if (constituent_has_default) then
call &
const_props(constituent_idx)%default_value(constituent_default_value, constituent_errflg,&
constituent_errmsg)
if (constituent_errflg .ne. 0) then
call endrun(constituent_errmsg)
end if
field_data_ptr(:,:,constituent_idx) = constituent_default_value
if (masterproc) then
write(iulog,*) 'Consitituent ', ccpp_required_data(req_idx), &
' initialized from file: ', constituent_default_value
' initialized to default value: ', constituent_default_value
end if
else
field_data_ptr(:,:,constituent_idx) = 0._kind_phys
Expand Down
10 changes: 8 additions & 2 deletions test/unit/sample_files/write_init_files/physics_inputs_noreq.F90
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ subroutine physics_read_data(file, suite_names, timestep, read_initialized_varia
type(ccpp_constituent_prop_ptr_t), pointer :: const_props(:)
real(kind=kind_phys) :: constituent_default_value
integer :: constituent_errflg
character(len=SHR_KIND_CX) :: constituent_errmsg
character(len=512) :: constituent_errmsg
logical :: constituent_has_default

! Logical to default optional argument to False:
Expand Down Expand Up @@ -152,14 +152,20 @@ subroutine physics_read_data(file, suite_names, timestep, read_initialized_varia
constituent_has_default = .false.
call const_props(constituent_idx)%has_default(constituent_has_default, &
constituent_errflg, constituent_errmsg)
if (constituent_errflg .ne. 0) then
call endrun(constituent_errmsg)
end if
if (constituent_has_default) then
call &
const_props(constituent_idx)%default_value(constituent_default_value, constituent_errflg,&
constituent_errmsg)
if (constituent_errflg .ne. 0) then
call endrun(constituent_errmsg)
end if
field_data_ptr(:,:,constituent_idx) = constituent_default_value
if (masterproc) then
write(iulog,*) 'Consitituent ', ccpp_required_data(req_idx), &
' initialized from file: ', constituent_default_value
' initialized to default value: ', constituent_default_value
end if
else
field_data_ptr(:,:,constituent_idx) = 0._kind_phys
Expand Down
Loading

0 comments on commit 3f400ec

Please sign in to comment.