Closed ekluzek closed 1 year ago
@slevisconsulting was able to remove the need for the paramfile in #46. So this is half done.
I have removed surfrd_get_data
& surfrdUtilsMod
in #63 (issue #60). However, I get the sense (though may be wrong) that subroutines surfrd_get_globmask
and surfrd_get_grid
are necessary to obtain ldomain, ni, nj, and possibly the landmask.
@slevisconsulting I'm not sure either, but I do think you should be able to pull it apart. ldomain, ni, nj and landmask should be coming from the domain file (or mesh when with NUOPC). It does get the surface dataset grid to ensure it's nearly the same as on the domain file. So I think you should be able to remove those two as well, but you'll need to make sure the read of the domain file is independent and you'll need to turn off that comparison test that's done.
@ekluzek I wonder whether this will be cleaner to do in the NUOPC version, or if it makes no real difference. Currently I'm finding that removing nothing but ldomain%frac
from the code (which is read from fsurdat) results in this error:
inconsistency between land fraction and sea ice fraction
n= 1 fracl= 8.2757835866914180E-313 fraci= 0.0000000000000000 sum= 8.2757835866914180E-313
n= 1 fracl= 0.0000000000000000 fraci= 0.78051247132006174 sum= 0.78051247132006174
ERROR: (seq_domain_check) inconsistency between land fraction and sea ice fraction
which doesn't feel promising about removing the fsurdat file, yet. I'm open to suggestions.
I'm actually not too surprised you ran into something like this, because things are fairly intertwined even though they don't really need to be. I'm still pretty sure that this can be removed, but it will take more unpicking. You are also right that this might be easier in the NUOPC version. It might be good to look at this together and decide on the way forward. For now, it seems like leaving the surface dataset to just read the grid isn't too bad to keep around for a little longer.
I added this comment in the code:
TODO Currently reading domain file, although this is done in surfrd.
In NUOPC version we will be reading ESMF mesh file. Until SLIM gets
updated to NUOPC, we are leaving the calls to surfrd unchanged.
I added this comment in the code:
TODO Currently reading domain file, although this is done in surfrd. In NUOPC version we will be reading ESMF mesh file. Until SLIM gets updated to NUOPC, we are leaving the calls to surfrd unchanged.
Clarification: I added the above comment to surfrdMod and before the calls to surfrd_get_globmask and surfrd_get_grid. As stated we're leaving these calls unchanged. The real issue with them is that they are located in surfrdMod although they have nothing to do with fsurdat. Ideally we would move them out o surfrdMod (both in SLIM and CLM), but at the moment this is secondary.
Completed this issue in #63 and closing.
The CLM fsurdat and paramfile that's currently in SLIM adds a lot of unneeded complexity and resolution dependence that we should be able to remove. Because, it's pretty entwined in the code, we think it will take some effort to remove. But, it's something that's likely going to be worth it to remove complexity that's visible to the user.