Ignore:
Timestamp:
Sep 3, 2025, 4:34:52 PM (4 months ago)
Author:
jbclement
Message:

PEM:
Managing automatically the slope variables outputted by XIOS according to 'nslope' to avoid subsequent errors.
JBC

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/LMDZ.COMMON/libf/evolution/deftank/lib_launchPEM.sh

    r3869 r3909  
    7777
    7878    sed -i 's/enabled="\.true\.\">/enabled=".false.">/g' file_def_physics_mars.xml
     79
    7980    while IFS= read -r line; do
    8081        case "$line" in
     
    8788        esac
    8889
     90        # Handle enabled attribute
    8991        if [[ $line == *'enabled="'* ]]; then
    9092            if $in_diurnalave; then
     
    99101                else
    100102                    line='              enabled=".true.">'
     103                fi
     104            fi
     105        fi
     106
     107        # Detect slope variables
     108        if $in_diurnalave_s && [[ $line =~ slope([0-9]+) ]]; then
     109            slope_id="${BASH_REMATCH[1]}"
     110            if (( 10#$slope_id > ns )); then
     111                # Ensure the line is commented
     112                if [[ $line != "<!--"* ]]; then
     113                    line="<!-- $line -->"
     114                fi
     115            else
     116                # Ensure the line is uncommented
     117                if [[ $line == "<!--"* ]]; then
     118                    line="${line#<!-- }" # remove leading <!--
     119                    line="${line% -->}"  # remove trailing -->
    101120                fi
    102121            fi
Note: See TracChangeset for help on using the changeset viewer.