gotm-model / code

Source code for the General Ocean Turbulence Model
https://gotm.net
GNU General Public License v2.0
53 stars 44 forks source link

gotm.yaml configuration files not valid YAML? #40

Closed poplarShift closed 9 months ago

poplarShift commented 9 months ago

The example cases available for GOTM online usually include a section along the lines of

output:
   out:                                # path of output file, excluding extension
      time_unit: hour                       # time unit [second, hour, day, month, year, dt=model time step; default=day]
      time_step: 6                         # number of time units between output [min=1; default=1]
      time_method: point                   # treatment of time dimension [point=instantaneous, mean, integrated; default=point]
      variables:
      - source: *                          # variable name in model

This can be parsed by yaml.F90, but is AFAIK not actually valid YAML - * starts an alias. This becomes a problem when trying to parse the gotm.yaml files with tools outside GOTM, which usually rely on valid YAML.

I'm unsure where this issue belongs - is it GOTM, https://github.com/BoldingBruggeman/fortran-yaml/, or elsewhere? Or was there once a YAML version where * was a valid start for a plain scalar?

jornbr commented 9 months ago

Hi Achim,

That’s correct – it does not show up when parsing with fortran-yaml (i.e., GOTM and FABM), as that does not recognize aliases, but it does cause trouble in other parsers. We therefore generally recommend using “source: /*”, which does the same but avoids the alias interpretation. However, it seems the test cases have not been updated yet to use that convention.

Cheers,

Jorn

From: Achim Randelhoff @.> Sent: Thursday, September 21, 2023 9:54 AM To: gotm-model/code @.> Cc: Subscribed @.***> Subject: [gotm-model/code] gotm.yaml configuration files not valid YAML? (Issue #40)

The example cases available for GOTM online usually include a section along the lines of

output: out: # path of output file, excluding extension time_unit: hour # time unit [second, hour, day, month, year, dt=model time step; default=day] time_step: 6 # number of time units between output [min=1; default=1] time_method: point # treatment of time dimension [point=instantaneous, mean, integrated; default=point] variables:

This can be parsed by yaml.F90, but is AFAIK not actually valid YAML - * starts an alias. This becomes a problem when trying to parse the gotm.yaml files with tools outside GOTM, which usually rely on valid YAML.

I'm unsure where this issue belongs - is it GOTM, https://github.com/BoldingBruggeman/fortran-yaml/, or elsewhere? Or was there once a YAML version where * was a valid start for a plain scalar?

— Reply to this email directly, view it on GitHub https://github.com/gotm-model/code/issues/40 , or unsubscribe https://github.com/notifications/unsubscribe-auth/AAUAAWQGRTMEKRWBRQST3C3X3P6DJANCNFSM6AAAAAA5BFVITU . You are receiving this because you are subscribed to this thread. https://github.com/notifications/beacon/AAUAAWSFCXSUBNXMIXPOPMDX3P6DJA5CNFSM6AAAAAA5BFVITWWGG33NNVSW45C7OR4XAZNFJFZXG5LFVJRW63LNMVXHIX3JMTHHDIRYXE.gif Message ID: @. @.> >

bolding commented 9 months ago

I'll update the cases

Karsten

Den tors. 21. sep. 2023 kl. 11.03 skrev Jorn Bruggeman < @.***>:

Hi Achim,

That’s correct – it does not show up when parsing with fortran-yaml (i.e., GOTM and FABM), as that does not recognize aliases, but it does cause trouble in other parsers. We therefore generally recommend using “source: /*”, which does the same but avoids the alias interpretation. However, it seems the test cases have not been updated yet to use that convention.

Cheers,

Jorn

From: Achim Randelhoff @.> Sent: Thursday, September 21, 2023 9:54 AM To: gotm-model/code @.> Cc: Subscribed @.***> Subject: [gotm-model/code] gotm.yaml configuration files not valid YAML? (Issue #40)

The example cases available for GOTM online usually include a section along the lines of

output: out: # path of output file, excluding extension time_unit: hour # time unit [second, hour, day, month, year, dt=model time step; default=day] time_step: 6 # number of time units between output [min=1; default=1] time_method: point # treatment of time dimension [point=instantaneous, mean, integrated; default=point] variables:

  • source: * # variable name in model

This can be parsed by yaml.F90, but is AFAIK not actually valid YAML - * starts an alias. This becomes a problem when trying to parse the gotm.yaml files with tools outside GOTM, which usually rely on valid YAML.

I'm unsure where this issue belongs - is it GOTM, https://github.com/BoldingBruggeman/fortran-yaml/, or elsewhere? Or was there once a YAML version where * was a valid start for a plain scalar?

— Reply to this email directly, view it on GitHub < https://github.com/gotm-model/code/issues/40> , or unsubscribe < https://github.com/notifications/unsubscribe-auth/AAUAAWQGRTMEKRWBRQST3C3X3P6DJANCNFSM6AAAAAA5BFVITU> . You are receiving this because you are subscribed to this thread. < https://github.com/notifications/beacon/AAUAAWSFCXSUBNXMIXPOPMDX3P6DJA5CNFSM6AAAAAA5BFVITWWGG33NNVSW45C7OR4XAZNFJFZXG5LFVJRW63LNMVXHIX3JMTHHDIRYXE.gif> Message ID: @. @.> >

— Reply to this email directly, view it on GitHub https://github.com/gotm-model/code/issues/40#issuecomment-1729156958, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACVA42M3NPXNPQQR5SR56MLX3P7FFANCNFSM6AAAAAA5BFVITU . You are receiving this because you are subscribed to this thread.Message ID: @.***>

-- Karsten Bolding @.*** +4564422058

poplarShift commented 9 months ago

Perfect, thanks a lot! Was just about to submit a PR but you beat me to it, Karsten.

bolding commented 9 months ago

if you have done the changes the we do the PR - that saves me doing the work - and emphasize you did it :-)

Den tors. 21. sep. 2023 kl. 11.07 skrev Achim Randelhoff < @.***>:

Perfect, thanks a lot! Was just about to submit a PR but you beat me to it, Karsten.

— Reply to this email directly, view it on GitHub https://github.com/gotm-model/code/issues/40#issuecomment-1729164098, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACVA42NGSPQJCG5O5XZJXWTX3P7WHANCNFSM6AAAAAA5BFVITU . You are receiving this because you commented.Message ID: @.***>

-- Karsten Bolding @.*** +4564422058