I'm just replying to say thank you Gerry! This fixed my problem! I fixed it slightly differently - instead of commenting out the two lines I chose to always use glysoa_simple and it works fine for now.Howdy Folks:
I hope I didn't join the party too late. I also run into this exact problem using WRF-Chem 4.4.1. To recap:
1) namelist:chem>chem_opt = 202ANDchem>aerchem_onoff = 1
2)fort.67created (i.e., "ASTEM internal steps exceeded 200" with "Large total lw" inrsl.errorfiles )
3) Segmentation fault
In my case, the model crashes irrespective the value ofchem>mozart_ph_diag, or any other flags that Ankan tried. The only sure fire way is to deactivate aerosol chamistry (i.e.,aerchem_onoff = 0).
Based on the exchange between Ankan's and Jordan, I have managed to isolate the problem to be in the subroutineglysoa_complex()inmodule_mosaic_gly.F, which is called in subroutineASTEM()inmodule_mosaic_therm.F, despite (again, according to Ankan) them no longer needed from WRF 4.0 onwards. The path of least resistence would be to remove these lines or comment them out.
Inmodule_mosaic_therm.F, locate the subroutineASTEM(). Scroll down about 70 lines or so to find the following code block:
Code:! condense inorganic semi-volatile gases hno3, hcl, nh3, and co2 call ASTEM_semi_volatiles(dtchem) ! semi-implicit + explicit euler if (istat_mosaic_fe1 .lt. 0) return if (glysoa_param == glysoa_param_simple) call glysoa_simple(dtchem) if (glysoa_param == glysoa_param_complex) call glysoa_complex(dtchem)
and remove/comment out the last two lines (i.e., theifstatements containingglysoa_param == ...).
However, thefort.67(i.e., the "ASTEM internal steps exceeded" messages and thersl.errorwarnings "Large total lw") will still happen. This warning message comes from the subroutineASTEM_semi_volatiles()as seen from the above code block, but is unlrelated to the segmentation fault. The only way I can think of is to increase the maximum number of allowable iterations.
To do this, return tomodule_mosaic_therm.Fand find the subroutineload_mosaic_parameters(). Look for the following lines a few lines below:
Code:! astem parameters nmax_astem = 200 ! max number of time steps in astem alpha_astem = 0.05 ! choose a value between 0.01 and 1.0
and increase the value ofnmax_astemto a larger (integer) value. Personally I don't think it is guaranteed to work, but it is still worth a try (in my case it worked when I increased it from 200 to 500).
After the changes, clean out the build and recompile. The code should at least stop crashing.
Hope that helps, Gerry.
P.S. - I managed to dig a little further in the subroutineglysoa_complex()inmodule_mosaic_therm.F, and suspect that there is a bug in the Runge-Kutta ODE solver subroutinerk4(), which is called byglysoa_complex()- but notglysoa_simple(), which explains why it does not crash with it. However, I was unable to devote more time to it beyond performing some rudimentary tests. Perhaps I will return to this when I have more time, or another person could pick this up in a more timely fashion find a more complete solution than what is presented above.
Thanks for contributing your solution!