Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

run BestTrack on 120m mesh v2.2 on Hera #77

Closed
ghost opened this issue Apr 13, 2021 · 13 comments
Closed

run BestTrack on 120m mesh v2.2 on Hera #77

ghost opened this issue Apr 13, 2021 · 13 comments

Comments

@ghost
Copy link

ghost commented Apr 13, 2021

Set up a BestTrack JSON configuration to run ADCIRC with BestTrack, unperturbed

Jaime has built a makefile system to run besttrack with parameters here: https://github.com/JaimeCalzadaNOAA/coastal-act/blob/updates/tasks/test_Mesh_120m_v22/best_track_storms/Makefile

@ghost ghost self-assigned this Apr 13, 2021
@ghost ghost added the adcirc-v55-hsofs label Apr 13, 2021
@ghost
Copy link
Author

ghost commented Apr 13, 2021

current BestTrack JSON:

class BestTrackForcingJSON(WindForcingJSON):
name = 'BestTrack'
default_filename = f'configure_besttrack.json'
field_types = {
'storm_id': str,
'start_date': datetime,
'end_date': datetime,
}
def __init__(
self, storm_id: str, start_date: datetime, end_date: datetime, nws: int = 20, **kwargs
):
if 'fields' not in kwargs:
kwargs['fields'] = {}
kwargs['fields'].update(BestTrackForcingJSON.field_types)
WindForcingJSON.__init__(self, nws=nws, **kwargs)
self['storm_id'] = storm_id
self['start_date'] = start_date
self['end_date'] = end_date
@property
def adcircpy_forcing(self) -> BestTrackForcing:
return BestTrackForcing(
storm_id=self['storm_id'],
nws=self['nws'],
start_date=self['start_date'],
end_date=self['end_date'],
)
@classmethod
def from_adcircpy(cls, forcing: BestTrackForcing) -> 'BestTrackForcingJSON':
return cls(
storm_id=forcing.storm_id,
nws=forcing.NWS,
start_date=forcing.start_date,
end_date=forcing.end_date,
)

@ghost
Copy link
Author

ghost commented Apr 13, 2021

this issue is related to #56

@ghost ghost changed the title run BestTrack on 120m mesh v2.2 run BestTrack on 120m mesh v2.2 on Hera Apr 13, 2021
@ghost
Copy link
Author

ghost commented Apr 13, 2021

this command should work:

initialize_adcirc \
  --output-directory run_adcirconly_besttrack_hsofs_250m \
  --mesh-directory /scratch2/COASTAL/coastal/save/shared/models/meshes/hsofs/250m/v1.0 \
  --modeled-start-time 20121022T060000 \
  --modeled-duration 04:05:00:00 \
  --modeled-timestep 00:00:02 \
  --tidal-spinup-duration 12:06:00:00 \
  --platform HERA \
  --adcirc-processors 600 \
  --adcirc-executable /scratch2/COASTAL/coastal/save/shared/repositories/ADC-WW3-NWM-NEMS/ADCIRC/work/padcirc \
  --adcprep-executable /scratch2/COASTAL/coastal/save/shared/repositories/ADC-WW3-NWM-NEMS/ADCIRC/work/adcprep \
  --modulefile /scratch2/COASTAL/coastal/save/shared/repositories/ADC-WW3-NWM-NEMS/modulefiles/envmodules_intel.hera \
  --job-duration 06:00:00 \
  --forcings tidal,besttrack \
  --tidal-source TPXO \
  --tidal-path /scratch2/COASTAL/coastal/save/shared/models/forcings/tides/h_tpxo9.v1.nc \
  --besttrack-storm-id sandy2012

@ghost
Copy link
Author

ghost commented Apr 14, 2021

the run at /scratch2/COASTAL/coastal/save/shared/working/zach/adcirc/run_20210413_besttrack_hsofs_250m seems to have run successfully, and timed out at hotstart as normal

Here is the code to convert the forcing from a BestTrackForcingJSON into an ADCIRCpy BestTrackForcing object:

@property
def adcircpy_forcing(self) -> BestTrackForcing:
return BestTrackForcing(
storm_id=self['storm_id'],
nws=self['nws'],
start_date=self['start_date'],
end_date=self['end_date'],
)

Then, add forcings to mesh:

LOGGER.debug(f'adding {len(self.forcings)} forcing(s) to mesh')
for adcircpy_forcing in self.adcircpy_forcings:
if isinstance(adcircpy_forcing, (Tides, BestTrackForcing)):
adcircpy_forcing.start_date = self['modeled_start_time']
adcircpy_forcing.end_date = self['modeled_end_time']
if (
isinstance(adcircpy_forcing, Tides)
and self['tidal_spinup_duration'] is not None
):
adcircpy_forcing.spinup_time = self['tidal_spinup_duration']
adcircpy_forcing.start_date -= self['tidal_spinup_duration']
elif isinstance(adcircpy_forcing, BestTrackForcing):
adcircpy_forcing.clip_to_bbox(mesh.get_bbox(output_type='bbox'), mesh.crs)
mesh.add_forcing(adcircpy_forcing)

@ghost
Copy link
Author

ghost commented Apr 14, 2021

the surface output fort.63.nc seems to have an empty zeta:

fort63_dataset = Dataset('/scratch2/COASTAL/coastal/save/shared/working/zach/adcirc/run_20210413_hsofs_250m_besttrack/runs/run_1/fort.63.nc')
print(fort63_dataset['zeta'].shape)
(0, 1813443)

@ghost
Copy link

ghost commented Apr 14, 2021

the surface output fort.63.nc seems to have an empty zeta:

fort63_dataset = Dataset('/scratch2/COASTAL/coastal/save/shared/working/zach/adcirc/run_20210413_hsofs_250m_besttrack/runs/run_1/fort.63.nc')
print(fort63_dataset['zeta'].shape)
(0, 1813443)

Perhaps the output frequency?
This should be accessible through driver.set_surface_elevation_output(*args, **kwargs).

@ghost
Copy link
Author

ghost commented Apr 15, 2021

updated the code setting the output frequency:

if self['output_elevations']:
if self['output_surface']:
driver.set_elevation_surface_output(
sampling_rate=self['modeled_output_interval'],
start=self['modeled_start_time'],
spinup=self['tidal_spinup_timestep'],
spinup_start=spinup_start,
)
if self['output_stations']:
driver.set_elevation_stations_output(
sampling_rate=self['modeled_output_interval'],
start=self['modeled_start_time'],
spinup=self['tidal_spinup_timestep'],
spinup_start=spinup_start,
)
if self['output_velocities']:
if self['output_surface']:
driver.set_velocity_surface_output(
sampling_rate=self['modeled_output_interval'],
start=self['modeled_start_time'],
spinup=self['tidal_spinup_timestep'],
spinup_start=spinup_start,
)
if self['output_stations']:
driver.set_velocity_stations_output(
sampling_rate=self['modeled_output_interval'],
start=self['modeled_start_time'],
spinup=self['tidal_spinup_timestep'],
spinup_start=spinup_start,
)
if self['output_concentrations']:
if self['output_surface']:
driver.set_concentration_surface_output(
sampling_rate=self['modeled_output_interval'],
start=self['modeled_start_time'],
spinup=self['tidal_spinup_timestep'],
spinup_start=spinup_start,
)
if self['output_stations']:
driver.set_concentration_stations_output(
sampling_rate=self['modeled_output_interval'],
start=self['modeled_start_time'],
spinup=self['tidal_spinup_timestep'],
spinup_start=spinup_start,
)
if self['output_meteorological_factors']:
if self['output_surface']:
driver.set_meteorological_surface_output(
sampling_rate=self['modeled_output_interval'],
start=self['modeled_start_time'],
spinup=self['tidal_spinup_timestep'],
spinup_start=spinup_start,
)
if self['output_stations']:
driver.set_meteorological_stations_output(
sampling_rate=self['modeled_output_interval'],
start=self['modeled_start_time'],
spinup=self['tidal_spinup_timestep'],
spinup_start=spinup_start,
)

120m v2.2 besttrack run outputs w/ stations, 2021-04-14

for the run in

/scratch2/COASTAL/coastal/save/shared/working/zach/adcirc/run_20210414_hsofs_120m_v2.2_besttrack

It looks like fort.61.nc and fort.63.nc have empty zeta arrays:

fort61_dataset = Dataset(COLDSTART_DIRECTORY / 'fort.61.nc')
print({variable_name: variable.shape for variable_name, variable in fort61_dataset.variables.items()})
{'time': (0,), 'station_name': (397, 50), 'x': (397,), 'y': (397,), 'zeta': (0, 397)}
fort63_dataset = Dataset(COLDSTART_DIRECTORY / 'fort.63.nc')
print({variable_name: variable.shape for variable_name, variable in fort63_dataset.variables.items()})
{'time': (0,), 'x': (5792708,), 'y': (5792708,), 'element': (11467160, 3), 'adcirc_mesh': (1,), 'neta': (), 'nvdll': (1,), 'max_nvdll': (), 'ibtypee': (1,), 'nbdv': (273,), 'nvel': (), 'nvell': (513,), 'max_nvell': (), 'ibtype': (513,), 'nbvv': (119521,), 'depth': (5792708,), 'zeta': (0, 5792708)}

@ghost
Copy link
Author

ghost commented Apr 15, 2021

From /scratch2/COASTAL/coastal/save/shared/working/zach/adcirc/run_20210414_hsofs_120m_v2.2_besttrack/coldstart/fort.15

NSPOOL**

-5 12.25 12.25 1                                                ! NOUTE TOUTSE TOUTFE NSPOOLE
-5 12.25 12.25 1                                                ! NOUTV TOUTSV TOUTFV NSPOOLV
-5 12.250000 12.250000 1                                        ! NOUTGE TOUTSGE TOUTFGE NSPOOLGE
-5 12.250000 12.250000 1                                        ! NOUTGV TOUTSGV TOUTFGV NSPOOLGV

it looks like the output frequency is still set to 12.25 seconds, even though I wanted 400 seconds for surface. I will look in the code

@ghost
Copy link

ghost commented Apr 15, 2021 via email

@ghost
Copy link
Author

ghost commented Apr 15, 2021

blocked by oceanmodeling/adcircpy#76 when passing end and spinup_end to driver.set_elevation_surface_output():

if self['tidal_spinup_duration'] is not None:
spinup_start = self['modeled_start_time'] - self['tidal_spinup_duration']
spinup_end = self['modeled_start_time']
else:
spinup_start = None
spinup_end = None
if self['output_elevations']:
if self['output_surface']:
driver.set_elevation_surface_output(
sampling_rate=self['surface_output_interval'],
start=self['modeled_start_time'],
end=self['modeled_end_time'],
spinup=self['tidal_spinup_timestep'],
spinup_start=spinup_start,
spinup_end=spinup_end,
)

@ghost
Copy link
Author

ghost commented Apr 16, 2021

issue solved by oceanmodeling/adcircpy#77

@ghost
Copy link
Author

ghost commented Apr 16, 2021

added fort.22 reading with oceanmodeling/adcircpy#78

@ghost
Copy link
Author

ghost commented Apr 19, 2021

run completed successfully at /scratch2/COASTAL/coastal/save/shared/working/zach/adcirc/run_20210416_hsofs_120m_v2.2_besttrack

@ghost ghost closed this as completed Apr 19, 2021
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

0 participants