Not sure if this is the correct place to post this. But I am using the MPAS tag 8.4.0 and believe this is still in the latest MPAS version. I am initializing from pressure level files from NOAA GFS and they are provided up to 1 Pa, 0.01 hPA.
I am running an MPAS configuration with a 70km model top so the initialization is provided above the model top. It is a bit odd, as the extrapolation method is specified though no extrapolation is occurring. Further, assume the recommendation for this situation is to use "linear" or "constant" which we have switched to. We were recommended to use lapse-rate initially from some folks at MMM so this is how we found this.
In the function vertical_interp contained in:
mpas_init_atm_vinterp.F
When `extrap_type == 2` so "lapse-rate" this function logs and returns:
```
if (target_z >= zf(1,nz)) then
if (extrap_type == 0) then
vertical_interp = zf(2,nz)
else if (extrap_type == 1) then
slope = (zf(2,nz) - zf(2,nz-1)) / (zf(1,nz) - zf(1,nz-1))
vertical_interp = zf(2,nz) + slope * (target_z - zf(1,nz))
else if (extrap_type == 2) then
call mpas_log_write('extrap_type == 2 not implemented for target_z >= zf(1,nz)', messageType=MPAS_LOG_ERR)
if (present(ierr)) ierr = 1
return
end if
return
end if
```
So though this is reported in the log, the worry is that believe Fortran function results aren't auto-initialized, vertical_interp's return value could be undefined or garbage. In our case the model merrily went along on it's way. So wondering if there are thoughts about to handle this case? One option could be to still log this, and potentially expand the log message, and take the action to fall back to constant?
```
else if (extrap_type == 2) then
vertical_interp = zf(2,nz)
call mpas_log_write('extrap_type == 2 not implemented for target_z >= zf(1,nz) falling back to constant', messageType=MPAS_LOG_ERR)
if (present(ierr)) ierr = 1
end if
```
Again in the current configuration it appears to execute, and the user will need to look at the logs to decide what to do. So this would remain the same, and if the user does not chose to switch to linear or constant they may have a better estimate. I guess the other option is to have it fall over much harder when this choice is used.
I am running an MPAS configuration with a 70km model top so the initialization is provided above the model top. It is a bit odd, as the extrapolation method is specified though no extrapolation is occurring. Further, assume the recommendation for this situation is to use "linear" or "constant" which we have switched to. We were recommended to use lapse-rate initially from some folks at MMM so this is how we found this.
In the function vertical_interp contained in:
mpas_init_atm_vinterp.F
When `extrap_type == 2` so "lapse-rate" this function logs and returns:
```
if (target_z >= zf(1,nz)) then
if (extrap_type == 0) then
vertical_interp = zf(2,nz)
else if (extrap_type == 1) then
slope = (zf(2,nz) - zf(2,nz-1)) / (zf(1,nz) - zf(1,nz-1))
vertical_interp = zf(2,nz) + slope * (target_z - zf(1,nz))
else if (extrap_type == 2) then
call mpas_log_write('extrap_type == 2 not implemented for target_z >= zf(1,nz)', messageType=MPAS_LOG_ERR)
if (present(ierr)) ierr = 1
return
end if
return
end if
```
So though this is reported in the log, the worry is that believe Fortran function results aren't auto-initialized, vertical_interp's return value could be undefined or garbage. In our case the model merrily went along on it's way. So wondering if there are thoughts about to handle this case? One option could be to still log this, and potentially expand the log message, and take the action to fall back to constant?
```
else if (extrap_type == 2) then
vertical_interp = zf(2,nz)
call mpas_log_write('extrap_type == 2 not implemented for target_z >= zf(1,nz) falling back to constant', messageType=MPAS_LOG_ERR)
if (present(ierr)) ierr = 1
end if
```
Again in the current configuration it appears to execute, and the user will need to look at the logs to decide what to do. So this would remain the same, and if the user does not chose to switch to linear or constant they may have a better estimate. I guess the other option is to have it fall over much harder when this choice is used.