Skip to content

Commit e97577e

Browse files
committed
Merge 2 if-blocks.
Second if-block had the same clause as first if-block, and it immediately followed the first if-block. Put add_latlon_atts line inside if (nRecordsOut == 0) block. Coordinate variable attributes will only be added during initial creation of output file, not if output file already exists.
1 parent 6fcab55 commit e97577e

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/convert_mpas.F

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -185,24 +185,24 @@ program convert_mpas
185185
end if
186186
stat = scan_input_free_field(field)
187187
end do
188-
end if
189-
stat = add_latlon_atts(output_handle)
190-
191188

192-
!
193-
! Write 'lat' and 'lon' fields for target mesh
194-
!
195-
if (nRecordsOut == 0) then
189+
!
190+
! Write 'lat' and 'lon' fields for target mesh
191+
!
196192
stat = remap_get_target_latitudes(remap_info, target_field)
197193
stat = file_output_write_field(output_handle, target_field, frame=0)
198194
stat = free_target_field(target_field)
199195

200196
stat = remap_get_target_longitudes(remap_info, target_field)
201197
stat = file_output_write_field(output_handle, target_field, frame=0)
202198
stat = free_target_field(target_field)
203-
end if
204199

200+
! Add units, long_name, standard_name attribute to coordinate variables.
201+
stat = add_latlon_atts(output_handle)
205202

203+
end if
204+
205+
206206
!
207207
! Loop over all times in the input file
208208
!

0 commit comments

Comments
 (0)