Skip to content

Commit

Permalink
for output_from_gcm, 0 levels => 2D field
Browse files Browse the repository at this point in the history
First version set num_levels = -1 for 2D fields, but 0 makes more sense
  • Loading branch information
mnlevy1981 committed Mar 18, 2023
1 parent 0c46cd5 commit 1828803
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/marbl_interface_public_types.F90
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ subroutine marbl_single_saved_state_construct(this, lname, sname, units, &
call marbl_status_log%log_error(log_message, subname)
end select
case (2)
if (trim(vgrid).eq.'none') then
if (trim(vgrid) .eq. 'none') then
allocate(this%field_2d(num_elements))
else
write(log_message,"(2A)") trim(vgrid), &
Expand Down Expand Up @@ -483,7 +483,7 @@ subroutine marbl_single_output_constructor(this, num_elements, num_levels, field
write(log_message, "(3A)") "Adding ", trim(field_name), " to outputs needed by the GCM"
call marbl_status_log%log_noerror(log_message, subname)

if (num_levels < 0) then
if (num_levels .eq. 0) then
allocate(this%forcing_field_0d(num_elements))
this%forcing_field_0d = c0
else
Expand Down Expand Up @@ -525,11 +525,11 @@ subroutine marbl_output_add(this, num_elements, field_name, output_id,
integer :: n, old_size, dim1_loc, dim2_loc, num_levels_loc

! Is this a 3D field?
! num_levels_loc = -1 => 2D field
! num_levels_loc = 0 => 2D field
if (present(num_levels)) then
num_levels_loc = num_levels
else
num_levels_loc = -1
num_levels_loc = 0
end if
if (associated(this%outputs_for_GCM)) then
old_size = size(this%outputs_for_GCM)
Expand Down

0 comments on commit 1828803

Please sign in to comment.