# Cpml conditions

**URL:** <https://community.geodynamics.org/t/cpml-conditions/1284>\
**Category:** SPECFEM\
**Created:** [June 9, 2020, 8:51am UTC](https://community.geodynamics.org/t/cpml-conditions/1284 "2020-06-09T08:51:12Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![kaoutar](https://avatars.discourse-cdn.com/v4/letter/k/7c8e57/32.png) [@kaoutar](https://community.geodynamics.org/u/kaoutar)\
**Post date:** [June 9, 2020, 8:51am UTC](https://community.geodynamics.org/t/cpml-conditions/1284/1 "2020-06-09T08:51:12Z")

</div>

Dear all,

I am facing a problem when I use the code : “xconvert\_external\_layers\_of\_a\_given\_mesh\_to\_CPML\_layers” whith a free surface at the top of the model.  
The code generates a " free\_or\_absorbing\_surface\_file\_zmax" file which contains only “0” as a value.  
And then when I try to execute the specfem3d code, it generates the error " wrong or empty definition of upper surface of the mesh in file free\_or\_absorbing\_surface\_file\_zmax"  
Can anyone help me with that please ?

Thanks a lot 🙂  
Stay safe.

---

<div class="post-metadata">

**Author:** ![Fr\_jun](https://avatars.discourse-cdn.com/v4/letter/f/34f0e0/32.png) [@Fr\_jun](https://community.geodynamics.org/u/Fr_jun)\
**Post date:** [June 29, 2025, 3:33am UTC](https://community.geodynamics.org/t/cpml-conditions/1284/2 "2025-06-29T03:33:51Z")

</div>

Hi kaoutar,  
I came across your post where you mentioned encountering the same error I’m currently facing when running xgenerate\_databases:  
error element face midpoint distance: 3.4609373E+10 - edge length:  
5.4250000E+10 tolerance: 5.4250004E+07.  
Could you please share more details on how you resolved this issue? Did you make any additional modifications to the mesh or parameters? Any help or guidance would be greatly appreciated!  
Thank you, and have a nice day!  
Best regards
