-
Notifications
You must be signed in to change notification settings - Fork 20
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
Landuse_ml problems #29
Comments
Is this |
The error message comes from Landuse_ml.f90:L700 if ( sumfrac < 0.99 .or. sumfrac > 1.01 ) then
write(unit=errmsg,fmt="(a34,5i4,f12.4,6i4,2f7.2)") & !nb len(dtxt)=13
dtxt//" SumFrac Error ", me,i,j, &
i_fdom(i),j_fdom(j), sumfrac, limax, ljmax, &
i_fdom(1), j_fdom(1), i_fdom(limax), j_fdom(ljmax), &
glat(i,j), glon(i,j)
print *, trim(errmsg)
if(abs(sumfrac-1.0)<0.2.and.abs(glat(i,j))>89.0)then
write(*,*)'WARNING: ',trim(errmsg),sumfrac,glat(i,j)
else
write(*,*)'lat/lon: ',trim(errmsg),glat(i,j), glon(i,j)
call CheckStop(errmsg)
end if
end if
do lu = 1, NLand_codes
if ( landuse_in(i,j,lu) > 0.0 ) then
call GridAllocate("LANDUSE",i,j,lu,NLUMAX, &
index_lu, maxlufound, landuse_codes, landuse_ncodes)
landuse_data(i,j,index_lu) = &
landuse_data(i,j,index_lu) + 0.01 * landuse_in(i,j,lu)
end if
if ( DEBUG%LANDUSE>0 .and. dbgij ) &
write(*,"(a15,i3,f8.4,a10,i3,f8.4)") "DEBUG Landuse ",&
lu, landuse_in(i,j,lu), &
"index_lu ", index_lu, landuse_data(i,j,index_lu)
end do ! lu
LandCover(i,j)%ncodes = landuse_ncodes(i,j)
LandCover(i,j)%codes(:) = landuse_codes(i,j,:)
LandCover(i,j)%fraction(:) = landuse_data(i,j,:)
sumfrac = sum( LandCover(i,j)%fraction(:) )
if(landuse_tot(i,j)< 0.99999 ) then
landuse_in(i,j,:)= 0.0 ! Will overwrite all PS stuff
dbgsum = 0.0
do ilu = 1, NLand_codes
landuse_in(i,j,ilu) = min(1.0, landuse_glob(i,j,ilu) )
dbgsum = dbgsum + landuse_in(i,j,ilu)
if ( dbgij ) then
write(*, "(a,i3,3es15.6,1x,a)") "F4 ", ilu, &
landuse_in(debug_li,debug_lj,ilu), &
landuse_tot(debug_li,debug_lj), dbgsum,&
trim(Land_Codes(ilu))
end if
end do
end if ! land_tot<0.9999 This looks to me like an error on the interpolation routine that reads call ReadField_CDF(trim(fName),varname,&
landuse_tmp,1,interpol='conservative', &
needed=.true.,debug_flag=.false.,UnDef=-9.9E19)
if ( ifile == 1 ) then
landuse_in(:,:,lu) = landuse_tmp
landuse_tot(:,:) = landuse_tot(:,:) + landuse_tmp
else
landuse_glob(:,:,lu) = landuse_tmp ! will merge below
end if What do you think? |
The interpolation routines that interpolates from lonlat grid to lonlat grid, are very complex. That means there is always the possibility that some corner case is not correctly handled. However we have had several cases with "landuse sumfrac errors" which all were due to wrong inputs. Anyway it would be necessary to reproduce the error before being able to trace this back. |
Hi Folks, |
You can download my configfile and one day of metdata from here: |
Hi Dave! So you were also at the dentist this morning? |
A general issue is that we shouldn't need the European data at all for an Asia run, and I can try to check that out (the current code was hacked together before the summer, but should be cleaned and improved anyway). Why the code works starts to fail with 4 or more processors sounds like a ReadField corner case, as suggested above. |
I tried with the metdata and the settings from John, and run on 4 processors without problems.
the last number shows that it has not been attempted overwritten by global data (I get zero there). Somewhat one of the two "if" failed:
I do not think it is an interpolation issue. Dave, if you can reproduce the error on Stallo I can find out. But maybe it would be better to try on "jacinth". |
Yes, it's rv4_15. The domain size in this case was 150x93. |
Hi @gitpeterwind , |
Hi again @gitpeterwind |
The piece of code above with "EuroFileFound" was actually taken from an older version. The problem is either
or landuse_glob which is wrong in
|
~mifapw/emep/emep-mscw/run.pl The important part is in config:
|
(and "isue29" is not a typo, but if you write issue with two "s", it will be replaced by 00... another issue!) |
As per Dave's suggestion, I tried to exclude the European data, by changing:
to:
Now I get a totally different error that doesn't depend on the number of processes:
Does this mean that EMEP can't find I also figured maybe there always has to be two landuse files, so I tried this:
Now, I got this error instead (also independent on the number of processes):
|
The code is still trying to find 2 MapFiles. No syntax problem in config
file?
|RdLanduseCDF: Starting 2 1|
The "2" means that it is looking for two MapFile
Edit:
It seems it is not enough to define one file.
But you could try to simply link twice to the glc file
|
I have the wrf meteo running on vilje now (though had to modify $GRID to GLOB, DEGREE_DAY_FACTORS to F, USE_WRF_MET_NAMES = T, emis etc.). I had problems with ForestFires (even after copying the 2016 data from stallo to vilje), but will come back to that. Tried 3 variations of cpu/processor:
and all worked, so I can't reproduce John's error there. Tomorrow I'll be in Chalmers and we can take a closer look. |
Yes, that is what I did, but then I ran into some other problems. Look at the end of my last post. |
Change Landuse_ml :
landuse_in = 0.0 !*** initialise ***
landuse_glob = 0.0 !*** initialise *** add also
if ( ifile == 1 ) then
landuse_in(:,:,lu) = landuse_tmp
landuse_tot(:,:) = landuse_tot(:,:) + landuse_tmp to be if ( ifile == 1 ) then
where (landuse_tmp>0.0) !Oct2017
landuse_in(:,:,lu) = landuse_tmp
landuse_tot(:,:) = landuse_tot(:,:) + landuse_tmp
end where !Oct2017 The first change is a simple initialisation that should always be done. The second is needed since the file-1 data might be undefined for the modelling area (or individual cells), as for example when running in Asia but file-1 is European. With the where statement we simply ensure that no attempt is made to use the data, and the file-2 global data will be used instead. The code still needs improvement, but try the above. |
Hi @gitpeterwind @avaldebe |
Great Dave! This seems to have solved it. I can now run on as many processors as I like. But I still need to include the European landuse file to make the it work. Specifying only Also, just to check: The simulations that I did before this fix (using less than 4 processors) should still be ok, right? There's no reason to suspect that this bug caused any silent errors in the results? |
Hi John, good we solved one problem anyway! Yeh, the code expects both files; that was just part of the hack done months ago. I need to re-write that one day, but probably not this week. About the earlier simulations, then I am not sure. There is a danger that things will change (it is always hard to know with initialisation issues). |
I just changed the heading so people don't think that the model has general problems with many processors. This particular case was an Asian domain running off WRF meteorology. /Dave |
It's ok that you changed the heading, but I don't think this bug was THAT specific. I had similar problems earlier when running the code for a European domain stretching just slightly outside the grid of the European landuse file. And that problem was not limited to running on multiple processes. My solution was then to use RUNDOMAIN to trim the domain to fit inside the European landuse grid. Missing to initialize to 0 can be really tricky bugs, because a lot of the time memory will be all zeros anyway. You never know what might cause the bug to suddenly appear. |
OK, point taken. The new title is now very general ;-) |
The GetEuroBVOC routine in Biogenics_ml.f90 needed CF,DF,NF and BF to be defined. Those are defined by the Landuse_PS_5km_LC.nc
|
This issue is label as solved. Why is till open? |
There are still small problems: you cannot specify only one landuse for example. |
And while commenting landuse improvements: The Landuse_PS_5km_LC.nc takes a long time to read for fine resolutions. It is slow also when the rundomain is covering a region outside Europe. A simple test could accelerate this. (A temporary fix is to specify the glc2000 twice in the config file) |
As far as I can tell, this was addressed on rv4_32. |
I seem to have no problem running EMEP in 1, 2 or 3 process (using for instance
mpiexec -np 3 Unimod
), but when I try to use 4 processes or more, EMEP crashes with the following output:Any idea what is causing this?
The text was updated successfully, but these errors were encountered: